Re: php and form mails

From: Date: Tue, 05 Mar 2002 06:16:23 +0000
Subject: Re: php and form mails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-87230@lists.php.net to get a copy of this message
Hi Try it like this <input type="radio" <? if ($form[gender] == "male") echo 'checked'; ?> name="form[gender]" value="male">male <input type="radio" <? if ($form[gender] == "female") echo 'checked'; ?> name="form[gender]" value="female">female Cheers Mojo Lmlweb@Mybc.Com <lmlweb@mybc.com> wrote in message news:20020305052111.DVPP29441.mta11.onebox.com@onebox.com... > 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 > lmlweb@mybc.com - email > (604) 693-1120 - voicemail/fax > >

« previous php.general (#87230) next »