note 100656 deleted from control-structures.else by sobak
| From: | sobak@php.net | Date: | Thu, 01 Dec 2016 17:53:21 +0000 |
| Subject: | note 100656 deleted from control-structures.else by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207909@lists.php.net to get a copy of this message | ||
Note Submitter: smoldar at gmail dot com
----
You can use the if to make a Yes/No field, verify if the statement is real or not and show the
correct option checked.
<?php if($variable == 'S') {?>
<input name="blah" type="radio" value="Y"
checked="checked"> Yes
<input name="blah" type="radio" value="N"> No
<?php } else {?>
<input name="blah" type="radio" value="Y"> Yes
<input name="blah" type="radio" value="N"
checked="checked"> No
<?php }?>