[FX.php List] Break up a big form

Bob Patin bob at patin.com
Wed Jul 19 16:39:12 MDT 2006


> OK. Here I go, breaking up a large form into several pages.
>
> Form1.php calls CreateRecord.php through a submit button.
> CreateRecord creates the record...and now I need to call form2.php.
> (Previously, a review page was displayed, which handled the whole  
> form).
>
> That's where I'm perplexed.
>
> Do I use an include(Form2.php) on the bottom of the  
> CreateRecord.php page, just after the FMNew function?
>
> Or, do I open a Form2.php as a whole new page?  If so, I can't  
> figure out which function does that, versus simply including on  
> existing page.
>
> Sorry for basic question.

No problem; everyone started in the same spot...

I process the 1st form in the 2nd page, which is also the submission  
page, part 2...

So the PHP at the top creates the NEW record, then immediately uses  
those same variables which I've captured from page 1, and plugs them  
into page 2, if you want the applicant to see them. For example, if  
page 2 should show the stuff they entered into page 1, and then adds  
some more input fields, this makes it really easy to do that.

You can use IF statements to make it so that if there's an error, a  
line of error text shows up, like this:

if ($newResult['errorCode']==0){

<<< here's the 2nd form's fields >>>

}else{

echo "There was an error, yada yada yada.";

}

Hope that helps,

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060719/a8805fe9/attachment.html


More information about the FX.php_List mailing list