Re: Re: R: [PEAR-DEV] HTML_QuickForm example

From: Date: Mon, 06 Mar 2006 21:04:38 +0000
Subject: Re: Re: R: [PEAR-DEV] HTML_QuickForm example
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-41682@lists.php.net to get a copy of this message
On 3/6/06, Atif Khan <wequar98@gmail.com> wrote: > Thats exactly what I am trying to learn. I understand the workflow. > I dont understand what is the purpose if the $target To point the form at another page. To allow you to post to another page/script if you want to. Remember you could also set it to: ?var=val or $_SERVER['PHP_SELF'] or some-such. If you want to validate server-side (which you should) then you either need to post to the same script or create the form object in the script you post to. > > void HTML_QuickForm::HTML_QuickForm ([string $formName = '' [, string > $method = 'post' [, string $action = '' [, string $target = > '_self' [, > mixed $attributes = NULL [, bool $trackSubmit = FALSE]]]]]]) > > I looked at the $form-exportvalues, but it does not really explain in > detail. > I am not a expert in PHP. > > You mentioned > > " In this case make sure that the page the receive the post must have the > script to validate the form " > > Am I suppose to use the $tracksubmit ?? That has nothing to do with this, although $tracksubmit is good to set. See above. > > > > Thanks > Atif > > Giuseppe Dessì wrote: > > > > > > > >> -----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 > > > > > > > > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.dev (#41682) next »