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

  • SEARCH
  • Home
  • 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

Alright I'll try to make this as clear as possible. Be kind, I'm very
Ill try and make this quick and easy...I hope, Right now I have a
I'll try to make this as simple as possible. I'm working on a site
Alright, I'll try and make this brief as possible. I wanted to a UIToolbar
Alright, I'll try and make this as simple as possible. I'm trying to create
I really think that here ill found my answers... I try to make a
i'll try and be as clear as possible. I'm working on some form validation
I'll try to make myself clear with an example: Imagine an admin page to
This is my first time on this forum and ill try to be clear
0K, here it the problem, I'll try to make it as clear as possible.

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.