I have a form with 3 radio buttons:
<tr>
<td class="formTitle" align="right">Select By:</td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<input type="radio" name="rpttype" id="type_pd" value="PD" onFocus="enableField()" rel="paydate">
<label for="type_pd">Pay Date</label><br />
<input type="radio" name="rpttype" id="type_pc" value="PC" onClick="enableField()" rel="paycycle">
<label for="type_pc">Pay Cycle</label><br />
<input type="radio" name="rpttype" value="DR" onClick="enableField()" rel="daterange" id="type_dr" />
<label for="type_dr">Date Range</label><br />
</td>
</tr>
If I select the paydate radio button, I would like the 'pay_date' field to be enabled and the other fields disabled. If I select the 'paycycle' control, then the paydate text box becomes disabled and the paycycle text box becomes enabled and so on and so forth.
<TR>
<td class="formTitle" align="right"><label for="pay_date"><span class="accessibility"></span>Pay Date:</label></td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<select name="pay_date" id="pay_date">
<cfloop query="getDates">
<option value="#DateFormat(getDates.PAYDATE)#" <cfif DateFormat(getDates.PAYDATE) EQ attributes.pay_date> SELECTED</cfif>>#DateFormat(getDates.PAYDATE)#</cfloop>
</SELECT>
</td>
</TR>
<tr>
<td class="formTitle" align="right"><label for="type_pc"><span class="accessibility"></span>Pay Cycle:</label></td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<select name="PayCycle" id="type_pc">
<cfloop query="getDates">
<option value="#getDates.PERIOD#" <cfif getDates.PERIOD EQ attributes.PayCycle> SELECTED</cfif>>#getDates.PERIOD#</cfloop>
</SELECT>
</td>
</tr>
I'm trying to use the getElementbyID code, but I'm not quite understanding it.
Thanks,
Sherry
<tr>
<td class="formTitle" align="right">Select By:</td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<input type="radio" name="rpttype" id="type_pd" value="PD" onFocus="enableField()" rel="paydate">
<label for="type_pd">Pay Date</label><br />
<input type="radio" name="rpttype" id="type_pc" value="PC" onClick="enableField()" rel="paycycle">
<label for="type_pc">Pay Cycle</label><br />
<input type="radio" name="rpttype" value="DR" onClick="enableField()" rel="daterange" id="type_dr" />
<label for="type_dr">Date Range</label><br />
</td>
</tr>
If I select the paydate radio button, I would like the 'pay_date' field to be enabled and the other fields disabled. If I select the 'paycycle' control, then the paydate text box becomes disabled and the paycycle text box becomes enabled and so on and so forth.
<TR>
<td class="formTitle" align="right"><label for="pay_date"><span class="accessibility"></span>Pay Date:</label></td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<select name="pay_date" id="pay_date">
<cfloop query="getDates">
<option value="#DateFormat(getDates.PAYDATE)#" <cfif DateFormat(getDates.PAYDATE) EQ attributes.pay_date> SELECTED</cfif>>#DateFormat(getDates.PAYDATE)#</cfloop>
</SELECT>
</td>
</TR>
<tr>
<td class="formTitle" align="right"><label for="type_pc"><span class="accessibility"></span>Pay Cycle:</label></td>
<td width="#variables.spacerWidth#"><img src="#application.imgSrc#dot.gif" width="1" height="1" border="0"></td>
<td valign="top" class="rowText">
<select name="PayCycle" id="type_pc">
<cfloop query="getDates">
<option value="#getDates.PERIOD#" <cfif getDates.PERIOD EQ attributes.PayCycle> SELECTED</cfif>>#getDates.PERIOD#</cfloop>
</SELECT>
</td>
</tr>
I'm trying to use the getElementbyID code, but I'm not quite understanding it.
Thanks,
Sherry