i use this script to disable an inputfield when checked:
<input type="text" id="textBox">
<input type="checkbox" id="checkBox" onclick="enableDisable(this.checked, 'textBox')">
<script language="javascript">
function enableDisable(bEnable, textBoxID)
{
document.getElementById(textBoxID).disabled = bEnable
}
i also want to give the inputfield a value when the radiobutton is checked
can someone point me to the right direction?
“want to give the input field a value when the radiobutton is checked” means
1) you don’t want to disable text box,
or
2) while selecting the checkbox, you want to give some specific value to text box?
For (1) dont use any function on ‘onClick’
For (2) use the following code..