Re: Help anyone
| From: | Mike Eheler | Date: | Thu, 29 Nov 2001 18:47:29 +0000 |
| Subject: | Re: Help anyone | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76074@lists.php.net to get a copy of this message | ||
ewwwww
How about:
?>
<select name="status">
<option value="On-Line"<? if ($edit['status'] == 'On-Line') { echo ' selected="selected"'; } ?>>On-Line</option>
<option value="Off-Line"<? if ($edit['status'] == 'Off-Line') { echo ' selected="selected"'; } ?>>Off-Line</option>
</select>
<?
There's much better/general ways to do it, but the above is a nice, clean, quick and dirty way of doing it. Yes, clean and dirty. ;)
Mike
Dan McCullough wrote:
Here is what I did. if ($edit[status]=="On-line") { print "Status: <select name=\"status\">\n"; print "<option value=\"On-line\" selected>On-line\n"; print "<option value=\"Off-line\">Off-line\n"; print "</select><br>\n"; } else { print "Status: <select name=\"status\">\n"; print "<option value=\"On-line\">On-line\n"; print "<option value=\"Off-line\" selected>Off-line\n"; print "</select><br>\n"; } //and if ($edit[single]=="1") { print "Single: Yes <input type=\"radio\" name=\"single\" value=\"1\" checked> or No <input type=\"radio\" name=\"single\" value=\"0\"><br><br>\n"; } else { print "Single: Yes <input type=\"radio\" name=\"single\" value=\"1\"> or No <input type=\"radio\" name=\"single\" value=\"0\" checked><br><br>\n"; } that works --- faeton <faeton@ua.fm> wrote:Hello Dan, Thursday, November 29, 2001, 7:11:22 PM, you've written: DM> I need to edit a entry into the database via an admin script, how do I work in a radio selection DM> box, and populate it with the correct selection? Something like that, maybe :) <input type="radio" name="var" value="1"> <input type="radio" name="var" value="2"> <input type="radio" name="var" value="3"> ------------------------------------------------ Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) faeton@xemichat.com www.xemichat.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net===== Dan McCullough ------------------------------------------------------------------- "Theres no such thing as a problem unless the servers are on fire!" h: 603.444.9808 w: McCullough Family w: At Work __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1