Could someone tell me why my variable ragenttxt does not pass to the funcion? Or maybe it as and I'm just not doing somthing else right.
Text Field and Checkbox
JavaScript Function
Text Field and Checkbox
Code:
<input name="ragenttxt" type="text" size="30">
<input name="ragentna" type="checkbox" value="NA" onClick="javascript:ChkBoxTxtDisable('ragenttxt')">
JavaScript Function
Code:
<script Language="JavaScript">
function ChkBoxTxtDisable(TxtBoxName){
if(document.MainForm.ragentna.checked)
{
document.MainForm.TxtBoxName.disabled=true;
document.MainForm.TxtBoxName.value='';
document.MainForm.TxtBoxName.className='TxtDisabled';
}
else
{
document.MainForm.TxtBoxName.disabled=false;
document.MainForm.TxtBoxName.className='TxtEnabled';
}
}
</script>