Re: Validating forms

From: Date: Tue, 03 Apr 2001 03:43:55 +0000
Subject: Re: Validating forms
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8167@lists.php.net to get a copy of this message
Julio, It is much more efficient to do that type of validation client-side, using Javascript. No sense in making another round trip to the server if not necessary. Here is a quicke example: if (document.autoform.txtVehicleNumber.value == ""){ document.autoform.txtVehicleNumber.focus() alert("Enter fleet vehicle number") return false } Have a look at http://www.wsabstract.com/ for good javascript info. good luck, Phil J. "Julio Cuz, Jr." wrote: > Hi-- > > I have a form that cannot have a specific field blank, so I would like to > add a message box saying "fill out the x field," is there a way to do this > WITHOUT having to refresh the page? > > Julio Cuz, Jr. > Riverside Community College > jcuz@rccd.cc.ca.us > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8167) next »