radio buttons

A

Anonymous

Guest
hi there,
I have made up a form and I want to send via e-mail the input. The problem is that although I know that for the text I only need to write $textname, I don't know how I have to handle the radio button. I wrote in PHP $radioButtonName but it returns empty.
Can you please help me?
thanks in advance,
Manos
 
When none of the radio buttons are selected the browser will not return any info about that radio-button. Same with check-boxes.
To make sure that one option is allways selected you can add "checked" to one of the radio-buttons tags. That button will than be selected by default.

Greetz Daan
 
ok then
my interest is to get input from the user if he checkes a radio or checkbox (preferably checkbox). How can I get the information that the checkbox has been checked?
thanks,
Manos
 
If a checkbox has been checked it is set in your script
you can use
Code:
isset($_POST['name_of_variable']);
to determine if the checkbox was checked or not.
If a checkbox wasn't checked, it's not available in your script, because the browser won't send any data about that checkbox back to the server in that case.

Greetz Daan
 
Back
Top