Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tricky Form Queueing Question

Status
Not open for further replies.

gambhir

Programmer
Oct 17, 2000
15
US
On my application, I have a form. Based on a quantity number that the user enters of that form, the user must then fill an additional form in the quantity stated on the forst form. The user must remain in that loop until all of the 2nd forms are completed.

Does anyone have an idea how this would look in its code structure?


Cheers friends,

sahil
 
You set session variables, containing the total number of forms needed to be filled and a counter.

The most simple way is to do this...

eg. When the first form (one that decides how many forms to be filled) is submitted, do something like...

<CFSET Session.NumToBeFilled = 5>


Before the second form (SecondForm.CFM) is displayed, check if counter is still less than the NumToBeFilled

<CFIF NOT ISDEFINED(&quot;Session.Counter&quot;)>
<CFSET Session.Counter = 0>
</CFIF>

<CFIF Session.Counter LT Session.NumToBeFilled>
.... display form
<CFELSE>
.... display finished filling out forms
</CFIF>


On the form update,
<CFSET Session.Counter = Session.Counter + 1>
<CFLOCATION URL=&quot;SecondForm.cfm&quot;>


Hope this helps.

Klotzki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top