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 -

  function checkOtherValues() {
	  if (document.myform.checkmember[0].checked==false) { 
I thought this should work, but I'm getting the following error -

document.myform.checkmember.0 is null or not an object
For the form, it's set in this way -

<input type="checkbox" name="checkmember[]" value="<?=$chmember[$i]?>" onClick="return checkOtherValues()">
<input type="text" name="checkvalue[]" size="5" value="<?=$chvalue[$i]?>" />
Any tips please? Thanks.