Radio button and javascript problem

wxdqz

New Member
hi, i try to enable and disable a select options by depending on the radio button that user click, but i couldn't make it work.
could you help me to solve the problem, i will be appreciate for your help.
below is my code:
---------------------------------------------------------------------
<%@page import="java.util.*" errorPage="ErrorHandler3.jsp"%>
<SCRIPT TYPE ="text/javascript" LANGUAGE="javascript">
<!--
function makeDisable()
{
var x=document.forms.myForm.FYear;
x.disabled=true;
}

function makeEnable()
{
var x=document.forms.myForm.FYear;
x.disabled=false;
}

}

//-->
</SCRIPT>
<form name ="myForm" method="POST" action="flightsearch.jsp">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="45%"></td>
<td width="55%">
<input type="Radio" name="type" value=http://www.webdeveloper.com/forum/archive/index.php/"Return" onClick="makeEnable();" checked>
Return
<input type="Radio" name="type" value="OneWay" onClick="makeDisable();">
One Way
</td>
</tr>
<tr>
<td><b><U>Date of Travel</U></b></td>
</tr>
<tr>
<td width="45%"><b>From :</b></td>
<td width="55%">
<select name="FYear" size="1">
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
</select>

<select name="FMonth" size="1">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>

<select name="FDay" size="1">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
</td>
</tr>
</table>
</form>
----------------------------------------------------------------------
thanks for your help.

regards,
yuetni Swee
 
Back
Top