Hi, I have a content page which uses a materpage.I have some textbox,checkbox and radio button controls on the content page.I want to toggle the textboxes present on the content page i.e(enabling and disabling) upon checking and unchecking checkbox and radiocontrols.can someone tell me how to do this.and also can I add the script in content page.?
I have written something like this..which is disabling the textbox,but upon unchecking the checkbox aslo it is remaining same.
document.getelementbyid('<%=text1.ClientID%>').disabled=true;
thanks.
santosh.
jake shiPosted Apr 1, 2008, 11:22 PM
if you don't want to let the page postback,you'd better write like this:
function disablet()
{
var tt = document.getElementById('ct100_**_yourtextboxname');
if(document.getElementById('ct100_**_yourcheckboxname').checked)
{ tt.style.disable=true; }
else{tt.style.disable=false;}
}
because you use the masterpage ,so your controls' name ,for example:checkbox 's id will be change, like:ct100$**$yourcheckboxid,you can pay attention to it.the checkbox or radio's checked type is bool,so you can use if to judge.