Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Thanked 0 Times in 0 Posts

    Input validation

    I have seen something similar to this in the threads, but tried my own version and it doesn't seem to be working. I have attached my script, if I could get a little help. Thank you.

    1. Create a cross-browser (works in Firefox and MS IE) input screen that takes in a client’s information for an order:
    * Full Name (text field)
    * Address (textarea)
    * Gender (radio button)
    * Date of birth (three dropdown lists – day, month, year)
    * “Send me newsletter” (checkbox)
    * Hidden total value for order (hidden field)
    * “Submit Order” button (button).
    2. When the user is done with input, validate using the rules below:
    * At least 3 characters required in name
    * Must be over 18 years old
    * Gender must be selected
    3. If validation passes, show the information in an alert box and write ‘Your order has been submitted’. Otherwise, alert the user with the appropriate validation error and set focus on the input field that failed validation.
    Attached Files Attached Files

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Cebu City, Philippines
    Thanked 372 Times in 365 Posts
    Get firebug. You'll see that the errors are common mistakes of not closing your function and disability to declare your variables.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts