R: [PEAR-DEV] HTML_QuickForm example
| From: | Giuseppe Dessì | Date: | Mon, 06 Mar 2006 18:36:19 +0000 |
| Subject: | R: [PEAR-DEV] HTML_QuickForm example | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41677@lists.php.net to get a copy of this message | ||
> -----Messaggio originale-----
> Da: Atif Khan [mailto:wequar98@gmail.com]
> Inviato: lunedì 6 marzo 2006 18.08
> A: PEAR Announce
> Oggetto: [PEAR-DEV] HTML_QuickForm example
>
> I am still having problems with HTML_QuickForm.
>
> I am trying to post to a different page
> after validating the form
>
> If I add a method
>
> $Form = new HTML_QuickForm("Form1", "POST", 'test.html');
>
> It seems that it did not like validating the form and going
> to the test.html page.
>
> how can I make sure that the page validates it first before
> pushing to the page.
>
> Mark posted stating
>
> " The form target needs to be script where the form is
> defined. After validating the form, you can redirect to your
> test.html (or include it)."
>
> Is there an example that I can take a look at.
>
> Thank you
> Atif K
>
The workflow is this:
Create a new object as you wrote
After post you can validate the form (server-side)
$form->validate();....so..if ($form->validate()) {some code}
After validating you can include o redirect to a page or do what you need.
But seem that you want to post to a different page than the script page.
In this case make sure that the page the receive the post must have the
script to validate the form
so you can use the values $form->exportvalues() or similar (read form manual
for reference) to feet your needed
Bye