Re: how to create multiple selects within php

From: Date: Mon, 18 Oct 2004 14:37:35 +0000
Subject: Re: how to create multiple selects within php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199728@lists.php.net to get a copy of this message
Please reply to the list. bruce wrote:
john.. thanks for the response... but i don't need a multiple select.. what i need are multiple select/menu lists...
list1    list2   list3....
however, the issue i'm really facing is how to detect that a user has actually selected an item in a given list, as opposed to the app simply returning the 1st item of a list, as the default if the list is not selected.... this is consistent with what the rfc/spec states the behavior should be...
Ahhhh....then just do your select like this... <select name="foo"> <option /> <option val="1" />fff <option val="2" />aaa So on and so forth. Leave the first <option> empty, and on the resulting page, if the user didn't select anything, $_POST['foo'] will not have a value. if ( $_POST['foo'] == "" ) { //user didn't select anything } -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#199728) next »