Re: Read Form values prior to submit?

From: Date: Sun, 28 Dec 2008 15:52:11 +0000
Subject: Re: Read Form values prior to submit?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-285142@lists.php.net to get a copy of this message
On Sun, Dec 28, 2008 at 12:41 PM, Tim Rude <tim_rude@yahoo.com> wrote: > Using PHP, is there a way for me to read the values that a user has > entered into the text fields of a <FORM> prior to the user clicking the > submit button? If the user doesnt press the submit button PHP has no idea what's going on there. That's client-side and you should use JavaScript for that. > Essentially what I want to do is make sure the user has filled in all > three text fields on my form before allowing it to be submitted [to a > third party website]. In case you have a specific business logic in that field and don't want the user to know about it, you should use AJAX. But this sounds simple, a small JS should help you. The JS can submit the form, if it's okay. Or you can add a action to form's onsubmit event. (you can "return false" if the validation fails). Hope this helps! Regards, Thiago Henrique Pojda nerdnaweb.blogspot DOT com > -- > > Tim Rude [PHP newbie] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#285142) next »