You are here: Re: Checkstate of Radiobutton « All PHP « IT news, forums, messages
Re: Checkstate of Radiobutton

Posted by J.O. Aho on 04/14/07 20:39

Samuel van Laere wrote:
> The last two hours i've been trying to make my form work,
> its contains two unchecked radiobuttons and a submit button.
> The user is able to choose either one of the two
> and send the form using the submit button.
> I would like to check (checked="checked") the radiobutton the user
> pickt _after_ submitting the form, but just can't get it to work.

<form action="apage.php">
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter"> Butter<br>
<input type="Submit">
</form>

switch($_REQUEST['group1']) {
case 'Milk':
echo "You like milk!<br>\n";
break;
case 'Butter':
echo "You like butter!!!<br>\n";
break;
default:
echo "You don't like anything<br>\n";
break; //not needed, but a good habbit
}

--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация