Re: Check input against list
| From: | Miles Thompson | Date: | Tue, 01 Aug 2000 20:42:11 +0000 |
| Subject: | Re: Check input against list | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9545@lists.php.net to get a copy of this message | ||
Set up an array of codes and whip down the array in a for loop; alternately
query against a table.
I'd be tempted to do the former in JavaScript before leaving the form.
Miles Thompson
David VanHorn wrote:
> I have a couple input fields that require ISO state and country codes.
>
> Is there some way to check that an input string is one of N possibilities,
> where N is a large-ish number?
> or do I have to do the ugly, obvious method like
>
> if (($ST <> "AK") or ($ST <> "AL")......... barf..)
> --
> www.SpamWhack.com A pre-emptive strike against spam
> Where's dave?
> http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
> My transistor sings
> with unintended parasitic
> the smoke escapes
>
> By Jeff Stout
>
> --
> 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