Re: Form Validation Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2007-05-23 at 07:41 -0500, kvigor wrote:
>
>     if($field == "conState" || $field == "schState" || $field == "strState") 
> //if these 3 fields are entered
>    {
>    if($value != 'Alabama' || $value!= 'AL' || $value != 'Alaska' || $value!= 
> 'AK' || $value != 'Arizona' || $value!= 'AZ' || $value != 'Arkansas' || 
> $value!= 'AR' || $value != 'California' || $value!= 'CA' || $value != 
> 'Colorado' || $value!= 'CO' || $value != 'Conneticut' || $value!= 'CT' || 
> $value != 'Delaware' || $value!= 'DE' || $value != 'Florida' || $value!= 
> 'FL' || $value != 'Georgia' || $value!=  'GA' || $value != 'Hawaii' || 
> $value!=   'HI' || $value != 'Idaho' || $value!= 'ID' || $value != 
> 'Illinois' ||  $value!= 'IL' || $value != 'Inidiana' || $value!= 'IN' || 
> $value != 'Iowa' || $value!= 'IA' || $value != 'Kansas' || $value!= 'KS' || 
> $value != 'Kentucky' || $value!= 'KY' || $value != 'Louisiana' || $value!= 
> 'LA' || $value != 'Maine' || $value!= 'ME' || $value != 'Maryland' || 
> $value!= 'MD' || $value != 'Massachusetts' || $value!= 'MA' || $value != 
> 'Michigan' || $value!= 'MI' || $value != 'Minnesota' || $value!= 'MN' || 
> $value != 'Mississippi' || $value!= 'MS' || $value != 'Missouri' || $value!= 
> 'MO' || $value != 'Montana' || $value!= 'MT' || $value != 'Nebraska' || 
> $value!= 'NE' || $value != 'Nevada' || $value!= 'NV' || $value != 'New 
> Hampshire' || $value!= 'NH' || $value != 'New Jersey' || $value!= 'NJ' || 
> $value != 'New Mexico' || $value!= 'NM' || $value != 'New York' || $value!= 
> 'NY' || $value != 'North Carolina' || $value!= 'NC' || $value != 'North 
> Dakota' || $value!= 'ND' || $value != 'Ohio' || $value!= 'OH' || $value != 
> 'Oklahoma' || $value!= 'OK' || $value != 'Oregon' || $value!= 'OR' || $value 
> != 'Pennsylvania' || $value!= 'PA' || $value != 'Rhode Island' || $value!= 
> 'RI' || $value != 'South Carolina' || $value!= 'SC' || $value != 'South 
> Dakota' || $value!= 'SD' || $value != 'Tennesee' || $value!= 'TN' || $value 
> != 'Texas' || $value!= 'TX' || $value != 'Utah' || $value!= 'UT' || $value 
> != 'Vermont' || $value!= 'VT' || $value != 'Virginia' || $value!= 'VA' || 
> $value != 'Washington' || $value!= 'WA' || $value != 'West Virginia' 
> ||$value!= 'WV' || $value != 'Wisconsin' || $value!= 'WI' || $value != 
> 'Wyoming' || $value!= 'WY') //if they don't the match these

I'm going to vomit after seeing your if statement's condition. Anyways,
you want && between all those and NOT ||.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux