hi
i have a jsp page in which there is three radio button one is for dropdown list,another is for text field and last is for File field.What i want is when someone select dropdown list other two fields should be blanked and disabled.and when i select file field then drop down list should set to default "Select one".At this time fields are becoming disabled but they are not set to blank.
I am using ie6.code is as follows
function val(radioId)
{
if(radioId==1)
{ window.document.form1.file.disabled=false;
window.document.form1.hd.value="file";
var nu_count = document.getElementById('count_msisdn');
nu_count.innerHTML="";
window.document.form1.baselist.value="Select one";
window.document.form1.baselist.disabled=true;
window.document.form1.mobile.value="";
window.document.form1.mobile.disabled=true;
}
else if(radioId==2)
{
window.document.form1.mobile.disabled=false;
window.document.form1.hd.value="msisdn";
alert(window.document.form1.file.value);
window.document.form1.file.value="";
alert(window.document.form1.file.value);
window.document.form1.file.disabled=true;
var nu_count = document.getElementById('count_msisdn');
nu_count.innerHTML="";
window.document.form1.baselist.disabled=true;
}
else
{
window.document.form1.baselist.disabled=false;
showcount();
window.document.form1.hd.value="basefile";
window.document.form1.file.value="";
window.document.form1.file.disabled=true;
window.document.form1.mobile.value="";
window.document.form1.mobile.disabled=true;
}
}
<INPUT TYPE="radio" NAME="radio" VALUE="msisdnbase" onclick="val('3')" ID="base"> Base-File</td>
<td align="left"><select name="baselist" style="width:260px" onchange="showcount()" disabled>
<option value="" label="">Select one</option>
</select> <span style="color:red; font-size: 10pt" count_msisdn"></span></td></tr>
<tr class="text"><td align=left colspan="2"><INPUT TYPE="radio" NAME="radio" VALUE="msisdn" onclick="val('2')" ID="message"> Msisdn </font></td>
<td align=left><textarea name="mobile" rows=3 cols=40 type="text" disabled></textarea></td></tr>
<tr class="text"><td align=left colspan="2"><input type="radio" name="radio" value="msisdnfile" id="file1" checked="checked" onclick="val('1')"> Msisdn File</font></td>
<td align="left"><input type="file" name="file" onkeydown="blur()" style="width:260px"/>