I have a radio (yes or no) in a form, i want to disable a textfield if i click "no" and enable again if i click "yes". Can some one please help me if you know how to do?
<script language='javascript'><!--
function disableit(answer);
{
if (answer == 0)
document.formName.txtfieldName.disabled = true;
else
document.formName.txtfieldName.disabled = false;
}
//--></script>
in your checkbox tags:
<input type="checkbox" value="yes" onClick='disableit(0)'>
<input type="checkbox" value="no" onClick='disableit(1)'>
hope it helps! Suceess, thats the way you spell success!
Got a question? Ask IMOZRMY!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.