Re: Read Form values prior to submit?

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

 



On Sun, Dec 28, 2008 at 12:41 PM, Tim Rude <tim_rude@xxxxxxxxx> 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
>
>

-- 
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