using radio buttons in html and php...
Posted: Mon Jul 03, 2006 9:59 am
Pimptastic | Please use
and the php codes:
Is that how we declare or use the radio buttons? The use could only choose one from Mr Mrs and Ms. But it should also only send one title that is chosen when the user fills up the form. So ... is there something wrong with my declarations? Thanks.
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
How do we declare variables if we have multiple radio buttons in html and would like to use it as a feedback form to send it thru the use of php codes?
If I have these codes in html:Code: Select all
<form action="../php/feedback.php" method="post" name="frmFeedback" id="frmFeedback">
<table width="600" border="0" align="center" cellpadding="1" cellspacing="2" bgcolor="#F5F5F5" class="feedback">
<tr>
<td width="164"><span class="style17"></span></td>
<td width="436"><span class="style17">
<label>
<input name="title" type="radio" value="mr" checked></label>
Mr.
<label>
<input name="title" type="radio" value="mrs">
</label>
Mrs.
<label>
<input name="title" type="radio" value="ms">
</label>
Ms. </span></td></tr></table></form>Code: Select all
$title = cleanUp($_POST['mr']);
$title = cleanUp($_POST['mrs']);
$title = cleanUp($_POST['ms']);
echo "<form action=\"feedback.php\" method=\"post\"><p>";
echo "<input type=\"radio\" name=\"title\" id=\"mr\" value=\"$title\" /> Mr<br />";
echo "<input type=\"radio\" name=\"title\" id=\"mrs\" value=\"$title\" /> Mrs<br />";
echo "<input type=\"radio\" name=\"title\" id=\"ms\" value=\"$title\" /> Ms<br />";
$message = "Title: $title \n";Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]