sending checkbox values to javascript function

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

sending checkbox values to javascript function

Post 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);
}
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: sending checkbox values to javascript function

Post by pickle »

Spell everything correctly ;)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply