0 Replies Latest reply on Aug 20, 2007 10:11 AM by jasons

    Spry Validation Text Box - Playing Nicely w/ Javascript

    jasons Level 1
      Greetings-

      I'm using the Spry Validation Text Fields in a registration form I'm designing. I really like the validation they provide. However, I'm trying to get them to play nicely with a password validation Javascript code that gets called when the form is submitted:

      Form Example

      The password validation JS compares the two email fields to make sure they are both the same. The JS is called when the form is submitted.

      <SCRIPT LANGUAGE="JavaScript">
      <!-- Begin
      function checkPw(form) {
      pw1 = form.password.value;
      pw2 = form.password_confirm.value;

      if (pw1 != pw2) {
      alert ("\nYour password confirmation failed. Please enter your passwords again.")
      return false;
      }
      else return true;
      }
      // End -->
      </script>

      However, this disables the Spry text field validations. I'm most certain my "OnSubmit" code causes the Spry validation to not execute.

      Any gurus have some ideas around this?

      Thank you.