You are here: Re: how to check a radio button « HTML « IT news, forums, messages
Re: how to check a radio button

Posted by Mark Parnell on 10/17/50 11:43

Deciding to do something for the good of humanity, juicy
<juicy_119@nospam.yahoo.com> declared in alt.html:

> <?php if($c = 1){ ?>

Will always return true. I think you mean <?php if($c == 1){ ?>.
http://www.php.net/manual/en/language.operators.comparison.php

> Please give some idea or useful links. Thanks.

<?php if($c == 1) { ?>
<input type="radio" checked="checked" value="1" name="c">
<input type="radio" value="2" name="c">
<? } else { ?>
<input type="radio" value="1" name="c">
<input type="radio" checked="checked" value="2" name="c">
<? } ?>

Perhaps not the most elegant solution, but it works. Gets messier the
more radio buttons you have. If it's only 2 like your example, then the
above will suffice.

--
Mark Parnell
Thankyou blinkynet!
http://blinkynet.net/comp/uip5.html

 

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

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