Hello there, I will quickly brief my problem with JavaScript
I am creating few sets of checkbox-texbox pairs upon check status of which the corresponding textbox will be enabled/disabled. I know this can be done by JavaScript but i don't want to create several function for each pairs of checkbox-textbox because i have lots of them...so what i did was something like this
======html=========
<input name="ccontact" type="checkbox" id="ccontact" value="checkbox" onClick="toggleTB(this)"/>
<input name="contact" type="text" id="contact" value="contact" readonly="true" />
Note that name of checkbox is preceding with one 'c' character with name name of textbox
======JavaScript part=======
<script type="text/javascript">
<!--
function toggleTB(what)
{
var theTB = what.name.substr(1); //this removes the preceding 'c'
var td = document.getElementsByName(theTB).name;
if(what.checked)
{
document.td.disabled=0;
}
else{
document.td.disabled=1;
}
}
//-->
</script>
but this is not working pls help!