#1
  1. superficial
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Peterborough, England
    Posts
    188
    Rep Power
    13

    JavaScript form validation


    I have a nice working script which I've used on a page out on the web, it validates name and organisation fields for a certain length, makes sure the input isnt numeric and isnt empty.

    I also have an email address checking function, using a regular expression.

    the final validation function makes sure a checkbox is ticked (to agree to the terms)

    this works fine.

    So, I re-conditioned it for another purpose and for some really annoying reason, it gives me an alert for the empty fields but once they are filled in, clicking the submit button does absolutely nothing, like return false would do. the page doesnt post.

    I usually debug javascript using the mozilla js console, but this shows nothing.

    if i comment out the lines that validate the two fields for emptiness, the email address checking and checkbox checking is done and i get the alerts saying so, add the two lines back in to check the first two text fields and it suddenly doesnt alert me to the email address or checkbox objects being blank or invalid.

    this is a real pain in the arse, can anyone suggest a reason why and a fix?
    Last edited by Utopia; October 15th, 2002 at 02:51 PM.
    _______________
    Matt
  2. #2
  3. // no comment
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2001
    Posts
    1,645
    Rep Power
    39
    well... if you'd post your validation script we can probably help you.

IMN logo majestic logo threadwatch logo seochat tools logo