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
radio buttons
Moderators: egami, macek, gesf
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
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
-
- New php-forum User
- Posts: 31
- Joined: Wed Oct 23, 2002 12:55 am
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
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 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
you can use
Code: Select all
isset($_POST['name_of_variable']);
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
-
- New php-forum User
- Posts: 31
- Joined: Wed Oct 23, 2002 12:55 am
thank you. I finally did it
regards,
Manos
regards,
Manos