How to retrieve value from the Check boxes?

后端 未结 2 1668
轻奢々
轻奢々 2021-01-25 04:13

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

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-25 04:56

    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:

    
         
    

    If you need the $msg variable to do something, assemble it after the output.

提交回复
热议问题