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 6908317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:32:52+00:00 2026-05-27T08:32:52+00:00

I’m new to programming so please forgive me if this is a dumb question…

  • 0

I’m new to programming so please forgive me if this is a dumb question…

I’m attempting to have javascript (or jquery – not sure of the difference) toggle the ‘disabled’ property of the submit button based on periodic form validation checks. It works fine when I key everything into the form, but if I copy and paste from the first password field into the second password field, the disabled property isn’t removed from the button.

Any help would be very much appreciated…

Javascript…

      $(':input').focusin(function(){

       $(this).css('background-color','#AABEFF');

        }).blur(function(){

       $(this).css('background-color','white');
          });

      function check(){

      if (($('#first').val()!="") && ($('#last').val()!="") && ($('#email').val()!="") && ($('#password1').val()!="") &&
      ($('#password2').val()!="") && ($('#phone1a').val()!="") && ($('#phone1b').val()!="") && ($('#phone1c').val()!="")){

           if (($('#password1').val())==($('#password2').val()))
              {
              $('#submit').removeAttr('disabled');
              }

           else

            {
             $('#submit').attr('disabled','disabled');
            }
      }

        else

            {
             $('#submit').attr('disabled','disabled');
            }
      }

      window.setInterval(check, 200);

Form….

        <html>
        <head>

          <link rel="stylesheet" type="text/css" href="style.css" />
        </head>

              <body>
                 <div id="back">
                 </div>

                <div id="wrapper">

                        <div id="header">
                         <div id="logout">
                        <?php
                      include 'employer_header.php';
                        ?>

                         </div>

                        </div>

                        <?php
                        include 'employer_menu.php';
                        ?>

                        <div id="feature">
                        </div>
                        <div id="content">

                        <div class="pad">

        <form method="post" action="employer_register_process.php">

        <p>First Name: <br>
        <input id="first" type="text" name="firstname" size="30"><br></p>
        <p>Last Name: <br>
        <input id="last" type="text" name="lastname" size="30"><br></p>
        <p>Phone 1: <br>
        <input id="phone1a" type="text" name="phone1a" style='width:30px' maxlength="3">-
        <input id="phone1b" type="text" name="phone1b" style='width:30px' maxlength="3">-
        <input id="phone1c" type="text" name="phone1c" style='width:40px' maxlength="4"><br></p>
        <p>Phone 2 (Optional): <br>
        <input type="text" name="phone2a" style='width:30px' maxlength="3">-
        <input type="text" name="phone2b" style='width:30px' maxlength="3">-
        <input type="text" name="phone2c" style='width:40px' maxlength="4"><br></p>
        <p>email: <br>
        <input id="email" type="text" name="email" size="30"><br></p>
        <p>password: <br>
        <input id="password1" type="password" name="pass1" size="30" mask="x"><br></p>
        <p>retype password: <br>
        <input id="password2" type="password" name="pass2" size="30" mask="x"><br></p>


        <p ><input id='submit' type="submit" name='submit' value='register' disabled='disabled'></p>
        </form>

                      </div>
                      </div>
                      </div>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/register.js"></script>
              </body>
        </html>
  • 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-27T08:32:53+00:00Added an answer on May 27, 2026 at 8:32 am

    you are not calling your check function.
    you should use jquery .keyup() function to check
    Here is an example of what your file would look like:

    $(':input').focusin(function(){
    
        $(this).css('background-color','#AABEFF');
    
    }).blur(function(){
    
        $(this).css('background-color','white');
    
    });
    
    function checkForm(){
    
      if (($('#first').val()!="") && ($('#last').val()!="") && ($('#email').val()!="") && ($('#password1').val()!="") &&
      ($('#password2').val()!="") && ($('#phone1a').val()!="") && ($('#phone1b').val()!="") && ($('#phone1c').val()!="")){
    
           if (($('#password1').val())==($('#password2').val()))
              {
              $('#submit').removeAttr('disabled');
              }
    
           else
    
            {
             $('#submit').attr('disabled','disabled');
            }
      }
    
        else
    
            {
             $('#submit').attr('disabled','disabled');
            }
      }
    
      $('#password2').keyup(function(){
             checkForm();
      });
    

    hope that helps

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.