Email Confirm

Discussion in 'JavaScript' started by adamjblakey, Apr 24, 2008.

  1. #1
    Hi,

    Please can someone have a look at this:

     if (form.email.value == form.confirm_email.value) {
        alert( "Please make sure your email address matches" );
        form.confirm_email.focus();
       return false ;
      } 
    Code (markup):
    It seems to come up as false every time even though the emails match. Is the code wrong?

    Cheers,
    Adam
     
    adamjblakey, Apr 24, 2008 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    Maybe this is the correct one
    
    if (form.email.value != form.confirm_email.value) {
        alert( "Please make sure your email address matches" );
        form.confirm_email.focus();
        return false ;
    }
    
    PHP:
     
    xrvel, Apr 24, 2008 IP
  3. adamjblakey

    adamjblakey Active Member

    Messages:
    1,121
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Works a treat thanks..
     
    adamjblakey, Apr 24, 2008 IP
  4. sherry2008

    sherry2008 Guest

    Best Answers:
    0
    #4
    he asked me to arrange 50 back links for his site for 75$ after i arranged 35 links and after this he asked me to stop work and refuse to pay.
     
    sherry2008, May 7, 2008 IP
  5. swordbeta

    swordbeta Banned

    Messages:
    225
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A bit logical.
    But do you understand what he changed?
    something == something
    They match^
    something != something
    They don't match^
     
    swordbeta, May 7, 2008 IP
  6. rkstech

    rkstech Active Member

    Messages:
    195
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #6
    JAvascript has != for checking IS NOT

    if (document.form.email.value != document.form.confirm_email.value) { alert( "Please make sure your email address matches" ); form.confirm_email.focus(); return false ;}
     
    rkstech, May 7, 2008 IP