Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4000462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:47:04+00:00 2026-05-20T07:47:04+00:00

Ill try and make this as clear as possible. I have a contact form

  • 0

Ill try and make this as clear as possible. I have a contact form on a page and a remote PHP file “random.php” that generates 2 random numbers:

<?php
    $randomNum = rand(0,9);
    $randomNum2 = rand(0,9);
    echo $randomNum . ' + ' . $randomNum2;
    $randomNumTotal = $randomNum + $randomNum2;
?>

the parent page calls it as such:

$(function() {
    $.get( 'PHP/random.php', function ( data ) {
    $('#ResetNumbers").val(data);    
});

and has an input:

<input type="text" class="numbers" name="ResetNumbers" id="ResetNumbers" value=""    size="6" readonly>

No problems to this point, the php file output’s the two random numbers and they are displayed on the page. Here’s the problem:
I have a second text box where you have to add the two numbers to make it validate.

<input type="text" class="numbers" name="ResetMath"  id="ResetMath" size="6" maxlength="6" tabindex="27">

It never works. It always says its not added correctly. here is the relevant part of my validation rule which is in another remote file:

ResetMath: {
    required: true, 
    equal: <?php echo $randomNumTotal; ?>
}

Since this is in a remote file (don’t want validation rules on the parent page) it doesn’t seem to be getting the same numbers. How do I unscrew this mess?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:47:05+00:00Added an answer on May 20, 2026 at 7:47 am
    ResetMath: {
        required: true, 
        equal: <?php echo $randomNumTotal; ?>
    }
    

    doesn’t seem right. It should be:

    ResetMath: {
        required: true, 
        equalTo: $('#ResetNumbers')
    }
    

    The API is here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll try to make this as straight forward as possible. Currently our team has
i'll try and be as clear as possible. I'm working on some form validation
I'll try to make myself as clear as possible. I made an installation program
I'll try and make this clear; I've got two classes; GPU(Object) , for general
I'll try to explain this better on another question. This is the query that
I have been puzzling over a problem this morning with LinqToSQL. I'll try and
I'll try to make this as simple a posible. I just started working with
I have a two part problem that needs fixing. I'll try my best to
I'm a bit of a rambler, but I'll try to keep this clear -
I'll try to explain my problem the best I can, here goes: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.