I\'m trying to get the emails corresponding to the checkbox using the following codes. But, I\'m not getting the correct checked emails in the new variable. Can anyone please ch
<input type="checkbox" name="add" value="<?php echo $msg.$info['email'];?>"/>
checkbox does not have onSelect event probobly you got value in mind and in PHP code you should echo
and what .", "
is for?
To get any value back for checkboxes they must have a value=
. In your case you probably would want the value to be the according email address.
One problem with your code is using onSelect=
instead of value=
, and second you didn't print the actual value into the page. Rewrite it to:
<td width="21" bgcolor="#f2f2f2">
<input type="checkbox" name="add"
value="<?php print $info['email']; ?>"/> </td>
If you need the $msg
variable to do something, assemble it after the output.