JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old November 10th, 2004, 03:44 AM
robocop robocop is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 3 robocop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>&nbsp;</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) &nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="mr">
Mr.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="mrs">
Mrs.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="miss">
Miss <span class="style9">** !<p></td>
</tr>
<tr>
<td colspan="2">&nbsp;</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>&nbsp;</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>

Reply With Quote
  #2  
Old November 10th, 2004, 09:48 AM
vickerst vickerst is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Tallahassee, FLorida
Posts: 7 vickerst User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
see reply in asp area.

Quote:
Originally Posted by robocop
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>&nbsp;</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) &nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="mr">
Mr.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="mrs">
Mrs.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="title" type="radio" value="miss">
Miss <span class="style9">** !<p></td>
</tr>
<tr>
<td colspan="2">&nbsp;</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>&nbsp;</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>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Radio buttons that dictate the rest of the form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway