<input type="radio" name="form[gender]" <?= ($form["gender"] == "male" ? "
checked" : ""); ?>value="male">male
<input type="radio" name="form[gender]" <?= ($form["gender"] == "female" ? "
checked" : ""); ?>value="female">female


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 4:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php and form mails


I have this simple formmail written out in PHP, and it checks for required
fields before sending out the email. If there is an empty required field,
it shows the form again, but with the fields filled out (if any). 

A coding example for a filled-out input field:

<input type="TEXT" name="form[street]" value="<?php echo $form[street];
?>" size="25">

or even as a pulldown menu:

<select name="form[province]">
 <option value="" selected>- Select Province/State -</option>
 <option value="<?php echo $form[province]; ?>" selected><?php echo
$form[province];
?></option>
etc

Now, I have a radio button selection, and I'm stumped at how to set it
up so that if someone has selected a radio button, how do I show this?

<input type="radio" name="form[gender]" value="male">male
<input type="radio" name="form[gender]" value="female">female

How would I show the selection if one of the radio buttons was selected?

-- 
Laurie Landry
[EMAIL PROTECTED] - email
(604) 693-1120 - voicemail/fax



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to