I have an application that uses a single form but uses DIV tags to display different sections with tabs.
I would like to be able to clear only certain form elements when they click on a different radio button.
Below is a little snippet of what I have:
So basically what I want to do, is when I select any of the radio buttons from group 1, I would like to reset those form elements back to default or nothing.
Is this possible in Javascript, or am I going to need to do some processing on the server based on which radio button in actually selected?
Any suggestions to accomplish this in a better way?
Any help is appreciated.
Thanks,
John
I would like to be able to clear only certain form elements when they click on a different radio button.
Below is a little snippet of what I have:
Code:
<tr>
<td style="border-right: 1px solid black;" width="15%"><input name="1" type="radio" value="" checked onClick="return showRecurrence('sh_single');">Single Event<br>
<input name="1" type="radio" value="" onClick="return showRecurrence('sh_daily');">Daily<br>
<input name="1" type="radio" value="" onClick="return showRecurrence('sh_weekly');">Weekly<br>
<input name="1" type="radio" value="" onClick="return showRecurrence('sh_monthly');">Monthly<br>
<input name="1" type="radio" value="" onClick="return showRecurrence('sh_yearly');">Yearly
</td>
<td valign="top">
<div id="singler" style="display:;">
</div>
<div id="dailyr" style="display: none;">
<input name="1a" type="radio" value="">Every <input type="text" size="5"> day(s)<br>
<input name="1a" type="radio" value="">Every WeekDay (M-F)
</div>
<div id="weeklyr" style="display: none;">
Recur every <input type="text" size="5"> week(s) on:<br>
<input type="checkbox"> Sun <input type="checkbox"> Mon <input type="checkbox"> Tue <input type="checkbox"> Wed<br>
<input type="checkbox"> Thu <input type="checkbox"> Fri <input type="checkbox"> Sat
</div>
<div id="monthlyr" style="display: none;">
<input name="1b" type="radio" value="">Day <input type="text" size="5"> every <input type="text" size="5"> month(s)<br>
<input name="1b" type="radio" value="">The
<select>
<option selected></option>
<option>First</option>
<option>Second</option>
<option>Third</option>
<option>Fourth</option>
<option>Last</option>
</select>
<select>
<option selected></option>
<option>Sunday</option>
<option>Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
<option>Thursday</option>
<option>Friday</option>
<option>Saturday</option>
</select>
every <input type="text" size="5"> month(s)
</div>
<div id="yearlyr" style="display: none;">
<input name="1c" type="radio" value="">Every
<select>
<option>January</option>
</select>
<input type="text" size="5"><br>
<input name="1c" type="radio" value="">The
<select>
<option selected></option>
<option>First</option>
<option>Second</option>
<option>Third</option>
<option>Fourth</option>
<option>Last</option>
</select>
<select>
<option selected></option>
<option>Sunday</option>
<option>Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
<option>Thursday</option>
<option>Friday</option>
<option>Saturday</option>
</select>
of
<select>
<option>January</option>
</select>
</div>
</td>
</tr>
So basically what I want to do, is when I select any of the radio buttons from group 1, I would like to reset those form elements back to default or nothing.
Is this possible in Javascript, or am I going to need to do some processing on the server based on which radio button in actually selected?
Any suggestions to accomplish this in a better way?
Any help is appreciated.
Thanks,
John