I wonder if anyone can help me please. I have created an htm page which has six checkboxes plus one text box within a form, i am trying to populate the text box when a certain checkbox is checked and i have modified some code that was given to me on this forum some time ago for another project however, i can get it to populate after i have checked the box and set the focus somewhere else but if I then uncheck the box I cannot get the text to disapear.
I have included the code below which i have set in the head
<script language="javascript" type="text/javascript">
<!-- Hide script from old browsers
function showVal(inField){
thisField = eval("document.frmLabel.chk7" + inField)
if (thisField.selectedIndex == 0){
eval("document.frmLabel.txtPallet" + inField + ".value = ''"
}
else{
eval("document.frmLabel.txtPallet" + inField + ".value = 'PALLET NEEDS SORTING'"
}
}
// end hiding script -->
</script>
And then I have this for the checkbox itself
<input name="chk7" id="chk7" type="checkbox" class="bigcheck" onChange="showVal('')">
<option value=""></option>
Regards
Paul
I have included the code below which i have set in the head
<script language="javascript" type="text/javascript">
<!-- Hide script from old browsers
function showVal(inField){
thisField = eval("document.frmLabel.chk7" + inField)
if (thisField.selectedIndex == 0){
eval("document.frmLabel.txtPallet" + inField + ".value = ''"
}
else{
eval("document.frmLabel.txtPallet" + inField + ".value = 'PALLET NEEDS SORTING'"
}
}
// end hiding script -->
</script>
And then I have this for the checkbox itself
<input name="chk7" id="chk7" type="checkbox" class="bigcheck" onChange="showVal('')">
<option value=""></option>
Regards
Paul