|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Radio buttons that dictate the rest of the form
Hi,
I am wondering if what I want to do with my form is possible or not. Although I posted the same question in the ASP forum, Javascript can also be used to create a form with the following requirements. I have this form below. And I would like the "Title" field to be the condition for setting validation rule. If a person selects "Dr" as his Title, then he will have to fill out the rest of the fields indicated by **. If the person selects the rest of the Title (Mr, Mrs, or Miss), then he will have to fill out the fields indicated by ! Will you please advise me how to do this by using Javascript? Thank you very very much, - R ========================= <html> <head> <title>Untitled Document</title> </head> <body> <!-- Begin HTML Form --> <form action="test_handle.asp" method="post" name="form" id="form"> <table width="500" border="0" align="center" cellpadding="2" cellspacing="2" id="regis_form"> <!-- first_name --> <tr> <td> </td> <td valign="top"><div align="right">** indicate a required field for doctors<br> ! indicates a required field for general public </div></td> </tr> <tr> <td colspan="2"> <p>Title : <!-- if dr. is checked, they must fill in all fields indicated by ** --> <input name="title" type="radio" value="dr" > Dr. (physicains) <input name="title" type="radio" value="mr"> Mr. <input name="title" type="radio" value="mrs"> Mrs. <input name="title" type="radio" value="miss"> Miss <span class="style9">** !<p></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="179"><p><b></b>First Name : </p></td> <td width="307" valign="top"> <p> <input name="name" type="text" id="name" size="20" maxlength="30"> **!</p></td> </tr> <tr> <!-- last_name --> <td><p>Last Name : </p></td> <td><input name="lastname" type="text" id="lastname" size="25" maxlength="35"> **!</td> </tr> <tr> <!-- degree --> <td width="179"><p>Specialty : </p></td> <td><input name="specialty" type="text" id="specialty" size="25" maxlength="40"> **</td> </tr> <tr> <!-- email --> <td><p><b></b>Email : </p></td> <td><input name="email" type="text" id="email" size="20" maxlength="40"> ** !</td> </tr> <tr> <td> </td> <td><input name="submit" type="submit" id="submit" value="Submit"><input name="reset" type="reset" id="reset" value="Reset"></td> </tr> </table> </form> </body> </html> |
|
#2
|
|||
|
|||
|
see reply in asp area.
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Radio buttons that dictate the rest of the form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|