Re: complicated questions
| From: | Andreas Pour | Date: | Sun, 06 Aug 2000 10:09:24 +0000 |
| Subject: | Re: complicated questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10317@lists.php.net to get a copy of this message | ||
Hi,
$used = array();
for ($ctr = 0; $ctr < 20; $ctr++)
if (isset($used[$text[$ctr]]))
break;
else
$used[$text[$ctr]] = "";
if ($ctr < 20)
// handle the error here
Ciao,
Andreas
Dragos Roua wrote:
>
> > HI,
> >
> > I have a very complicated questions to ask..escpcially this is very
> complicated for myself.
> > I have ten input text box, and the value of each input text box cannot be
> the same as the others or the rest.
> > How to construct the script to check for the validate of each input text
> box having different values in a timely and efficient manner.
> >
> > I don't want to have all 45 scripts to check base on 10 input text box, such
> as 1!=2, !!=3, 1!=4, 1!=5, 1!=6...and so so...... And If i have 20 input text
> box...i will need 190 queries to check them out....so how to compare thoes ten
> input text box in one query . Or Any suggestions is Helpful
> >
> >
>
> It seems to me that the best way to do it is to validate this on the client-side
> (i.e. JavaScript) and not on the server-side (i.e. PHP). There is a class
> written by Manuel Lemos wich was very helpfull to me several times, it's called
> forms.class and it can be found at phpclasses.upperdesign.com (do a search for
> this name).
>
> Basically, this class construct forms in PHP but it also have a very powerfull
> mechanism of verifiyng the user input in JavaScript. It has verifications for
> field equal to each other, different from each other, email, credit card, and so
> on.
>
> It worked for me so hope this helps ;-))
>
> --
> Dragos Roua
> Mirabilis Media,
> http://www.portal.ro
> http://www.net-info.ro
> http://www.analyser.ro http://www.adserver.ro
> http://www.culinar.ro http://www.cartipostale.ro
>
> --
> 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