www.webdeveloper.com
Results 1 to 2 of 2

Thread: [Urgently] Form Validation (If & then)!

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    [Urgently] Form Validation (If & then)!

    Hi guys, first i hope u will understand me...
    So i want to make a javascript to be shown if somebody chooses option A to show the javascripts for the A1,A2,A3 and if they choose B to show javascripts for the B1,B2,B3. So the A and B it will firstly asked as options from a <select> tag
    eg.
    Code:
    <select name="AorB" >
    <option value="" selected="selected">Select...</option>
    <option value="A" >Option A</option>
    <option value="B" >Option B</option>
    </select>
    I'm using this way of javascript (Error Alerts):

    Code:
    <SCRIPT language=JavaScript>
    <!--
    function check(form) {
    if (form.Password.value == "")
    { alert("Please enter your Password."); form.Password.focus(); return;}
    if (form.Password.value.length < 8)
    { alert("Please enter a valid Password."); form.Password.focus(); return;}
    form.submit()
    }
    //-->
    </SCRIPT>
    P.S: I don't want to make complications when they choose A to get B option javascripts or reverse.

  2. #2
    Join Date
    Nov 2012
    Posts
    2
    added- explain: i mean if We select OPTION A there will be shown some Input-s ....and javascript will ask only for the shown input-s so it means OPTION A input-s ... but not to ask for OPTION B input-s too even that they're not shown cause we didnt select OPTION B ... i hope i explained a little for you.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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