[FX.php List] Break up a big form

Jonathan Schwartz jonathan at eschwartz.com
Wed Jul 19 18:29:45 MDT 2006


Gjermund,

If this was intended for me, it's a little over my head at the 
moment.  I'm still trying to do things in the most basic sense.

Give me time.

Thanks.


At 1:03 AM +0200 7/20/06, Gjermund Gusland Thorsen wrote:
>Did you ever consider to do something like this:
>
>foreach( $_REQUEST['s'] as $key => $value ) {
>	if( $value != "" ) {
>		$q->AddDBParam( 'webSurvey'.$key, $value );
>	}
>}
>
>ggt667
>
>On 7/20/06, Bob Patin <bob at patin.com> wrote:
>>Well, I think his whole question was how to best break up a
>>submission process into multiple forms. I do this when applications
>>involve a lot of fields, because in the past I've had to spend far
>>too much time with clients who said that they were receiving
>>applications with too many errors on them.
>>
>>So I always take big application systems, where the applicant has to
>>make a lot of decisions (meals, conference choices, card payment,
>>shuttles, etc.) and break them into multiple pages. My clients have
>>been much happier with this approach.
>>
>>I've noticed that a lot of large sites have gone to using multiple
>>forms with only a few questions on each page, rather than one huge
>>overwhelming form, which non-web savvy users always find very
>>intimidating.
>>
>>You could of course put ALL of it on one page, but for me that's just
>>too much information and code in one page. I'd rather have separate
>>HTML pages to work with, and because they're so tiny, the size is
>>totally irrelevant.
>>
>>Bob
>>
>>
>>On Jul 19, 2006, at 5:50 PM, Gjermund Gusland Thorsen wrote:
>>
>>>  Why not have all the communication with the database in one file?
>>>
>>>  CreateRecord.php for example..
>>>
>>>  ggt667
>>>
>>>  On 7/20/06, Bob Patin <bob at patin.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  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
>>>>
>>>>
>>>>
>>>>  _______________________________________________
>>>>  FX.php_List mailing list
>>>>  FX.php_List at mail.iviking.org
>>>>  http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>>
>>>>
>>>  _______________________________________________
>>>  FX.php_List mailing list
>>>  FX.php_List at mail.iviking.org
>>>  http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>_______________________________________________
>>FX.php_List mailing list
>>FX.php_List at mail.iviking.org
>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 

Jonathan Schwartz
Schwartz & Company
817 Marin Drive
Mill Valley, CA 94941
Phone: 415-381-1852
jonathan at eschwartz.com - http://www.eschwartz.com



More information about the FX.php_List mailing list