hi..
i have two radio buttons.
for radio button1 i have placed a file upload control. and radio button2 another textbox control is placed..
if i select radiobutton1 then textbox1 should be disabled and if i selects radio button 2 file upload1 should be disabled..
and also i want validate the enabled file upload control and enabled textbox control.(i.e to place required field validator).
give the proper script for my requirement..
this is my script..
but it works partially..
need ur suggestions..
function disablefileupload()
{
var rdb1=document.getElementById("RadioButton1");
var rdb2=document.getElementById("RadioButton2");
var fu1=document.getElementById("FileUpload1");
var fu2=document.getElementById("FileUpload2");
if(rdb1.checked==true)
{
document.getElementById("TextBox1").disabled = true;
document.getElementById("FileUpload1").disabled = false;
ValidatorEnable(document.getElementById("<%=RequiredFieldValidator1.ClientID%>"),true);
ValidatorEnable(document.getElementById("<%=RequiredFieldValidator2.ClientID%>"),false);
}
else if(rdb2.checked==true)
{
document.getElementById("FileUpload1").disabled = true;
document.getElementById("TextBox1").disabled = false;
ValidatorEnable(document.getElementById("<%=RequiredFieldValidator1.ClientID%>"),false);
ValidatorEnable(document.getElementById("<%=RequiredFieldValidator2.ClientID%>"),true);
}
}
regards
gopal.s