37 users online (0 members and 37 guests)  


  Results 1 to 2 of 2

Related

  1. Code to Change Picture Based on Drop Down Option Selected    Forum: Website Scripts Forum
    Replies: 9
  2. Help!!Drop Down Menu Validation!URGENT!    Forum: Javascript Forum
    Replies: 1
  3. Replies: 8
  4. Replies: 2
  5. Jump Menu covers drop down menu    Forum: HTML Forum
    Replies: 1
  1. #1
    RandallFlagg's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2010
    Posts
    2

    Drop Down menu Validation change mind?

    Im confused by the validation aspect of my web form. If the user changes their mind from a drop down it still asks for a validation of previous selection. for example.

    I select "oranges" and an input box appears asking how i would like my oranges prepared. if i enter nothing and submit then error please input how you would like your oranges prepared appears.
    say i meant to select "apples" but selected "oranges" by accident and i switch my selection back to "apples" and an input box appears asking how would i like my apples appears. I enter nothing or i enter sliced then submit and then an error how would you like your oranges prepared appears.

    hope im not confusing anyone. i just need help on how to block if something else is selected.

  2. #2
    RandallFlagg's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2010
    Posts
    2

    Re: Drop Down menu Validation change mind?

    I forgot to say hi to all in my first post. So hello!! forum newbie here. Thanks for viewing the page, but I figured it out on my own. If anyone is curious how i fixed the issue here is the answer. If anyone has a better way please post answers. obviously my form isnt about fruit but of sensitive nature for work.


    PHP Code:
    if ((theForm.fruit.value == "Apples") && (theForm.prepared.value == "")) 
     

        { 
    alert ("Please select how would you like apple prepared in the \"prepared\ field");
               return (
    false);
     }
     
     else if ((
    theForm.fruit.value == "Oranges") && (theForm.prepared.value == "")) 
     
     { 
     
    alert ("Please select how would you like Oranges prepared in the \"prepared\ field");
     
    theForm.exempt_reason.blur();
               return (
    false);
      
      }