www.webdeveloper.com
Results 1 to 4 of 4

Thread: validating option in dynamic drop-down

  1. #1
    Join Date
    Mar 2004
    Posts
    12

    Question validating option in dynamic drop-down

    Hi All,
    I am creating a form which uses javascript to build a drop-down. The option elements in the drop-down are different depending on which radio button is chosen at the top of the screen.

    A person can choose 1 from 4 radio buttons:
    ULI
    PSI
    HR
    SSS

    If they choose ULI or PSI, the drop-down is injected with options; if they choose HR or SSS, it is greyed-out because this field is not applicable.

    I'd like to do validation when the ULI or PSI radio button is chosen to verify that the user also chooses an option from the drop-down box.

    When I added code to the javascript to do this validation, the rest of the validation no longer worked. In other words, it just let me hit submit and forwarded me to the next screen without any validation happening. I don't understand why it would break all the validations.

    The code is pretty lengthy so I attached both the javascript file and php page in text format. I had to combine it in one text page because this bulletin board only allowed one attached file.

    Any ideas/suggestions?

    -Patricia
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2002
    Location
    Taiwan
    Posts
    1,297
    Okay, the code isn't exactly optimized or anything, but it works. At least it worked for me... Anyway, it's attached.
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2004
    Posts
    12

    Talking

    Exuro,
    Can you tell I'm a rookie coder? You're solution worked perfectly ! I am amazed that people (you) could just whip up the right code very quickly.

    Thank you so much for helping me!!
    Many good things your way!
    Best, Patricia


  4. #4
    Join Date
    Dec 2002
    Location
    Taiwan
    Posts
    1,297
    The only reason it works is because I thoroughly tested the script before I posted it, otherwise I'm sure there'd have been plenty of kinks in it . But anyway, you're welcome!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles