Page 1 of 1

sending checkbox values to javascript function

Posted: Thu Mar 27, 2008 1:27 am
by thatsme
Hello,

I am trying to pass the checked member ids to javascript function. The values are not alerting. Can some one tell me how to pass the checked checkbox values to javascript function?

Code: Select all

 
for($i=0; $i<count($mem_id); $i++)
{
  echo  "<input type='checkbox' name='memeber_id[]' value='$mem_id[$i]'>" 
}
echo <input type='button' name='submit' value='submit' onClick='getCheckedMemeberId(member_id.value)'>
 

Code: Select all

 
function getCheckedMemeberId(member_ids)
{
   alert(member_ids);
}

Re: sending checkbox values to javascript function

Posted: Thu Mar 27, 2008 10:21 am
by pickle
Spell everything correctly ;)