Hi
I'm having an array dynamically fetched from the database using php, in result, I'm getting a check box, with their corresponding value.
I wanted to make a javascript function so that if I uncheck a checkbox, corresponding value disappears.
Before going to the looping, I was trying to do a simple check - like this -
I thought this should work, but I'm getting the following error -Code:function checkOtherValues() { if (document.myform.checkmember[0].checked==false) { document.myform.checkvalue[0].value=""; } }
For the form, it's set in this way -Code:document.myform.checkmember.0 is null or not an object
Any tips please? Thanks.Code:<input type="checkbox" name="checkmember[]" value="<?=$chmember[$i]?>" onClick="return checkOtherValues()"> <input type="text" name="checkvalue[]" size="5" value="<?=$chvalue[$i]?>" />




Bookmarks