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]
|