RE: [PHP] verifying that a dropdown was selected
| From: | Don Read | Date: | Thu, 05 Jul 2001 10:03:29 +0000 |
| Subject: | RE: [PHP] verifying that a dropdown was selected | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56284@lists.php.net to get a copy of this message | ||
On 05-Jul-01 Richard Kurth wrote:
>
> I have a dropdown box that is for selecting the month How can I be
> verified that the customer has selected one of the months. I am using
> verification like this but it does not do what I want for a dropdown
> box it works fine for regular fields
>
> if ($month == "") {
>
> $month_err = "
> <font color=red>Please enter the Month of expiration!</font><br>
> ";
> $send = "no";
>
>
>
>
> <select name='month' size='1'>
> <option value='00' ></option>
> <option value='01' >01</option>
> <option value='02'>02</option>
> <option value='03'>03</option>
> <option value='04'>04</option>
> <option value='05'>05</option>
>
>
>
look at your <option value=xx>.
if ( (isset($month)) && ($month +0 > 0) ) {
...
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.