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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two part form?

Status
Not open for further replies.

rhyno2k

IS-IT--Management
Jun 9, 2001
222
US
Hi,


I'm at a creative loss...

I'm trying to take my one-page form, which works beautifully, and turn it into a two-part form. The way it would work is at the end, before submitting, the user would have the option to check a box to provide additional information - this would then take the user to another form.

The only problem is the form processor integrated submitted data into a dBase database, and I can't submit each form independently.

So do i:
1) Pass all of the variables along to form2.asp using a huge "post=form2.asp?firstname=John?lastname=Doe?address=..." hyperlink?

2) I don't want to use cookies -- is there a way to have the checkbox "reveal" a part of the form? I can do that in DHTML, but want to keep this for the lowest comment denominator possible.


Thanks for any suggestions,
--RHYNO
 
Yep! You can "hide" part of the form using an HTML span. Check out this link for an example:


In the example you see that you can make the enclosed HTML visible or hidden just uasing a style setting. The above link comes from another page:


Check it out.

Hope this helps! :)
 
Nagrom,


Thanks for the suggestion... however, it's using <SPAN> tags, DHTML, etc. I'm looking for (hopefully) a pure ASP-based solution to reveal two/three table rows with additional form tags if a particular item in the previous menu is selected.

The alternative I'm trying to avoid is to pass all the variables along to a second form...


Thanks,
--RHYNO
 
If you do not use javascript (or some other client side script) there is no way for you to &quot;hide&quot; part of the form. The second you choose to hide/show something you have made the HTML dynamic and require script to control it. The only other way you have to do it is to make another trip to the server and redirect either to a &quot;completion&quot; page or to the additional form fields page (and put the data you have already retrieved into hidden tags or something) based on whether or not you want to see the rest of the form.
 
The only other way that I can think of doing this aside of Nagrom's suggestion, would be to use a popup window for the additional form, and upon completion of that form, you could first send all the values down to the parent page, plugging them into hidden form variables on your main form, and then submitting the information all in one nice, neat package.

Definitely not going to be able to hide part of the form on the same page, and then show it when a box is checked unless you want to use DHTML.

Here's a FAQ on how to send the data down complete with a little simplified example:
faq216-692

Then, just keep in mind that once you've sent the data down, you can just issue the:
window.opener.document.formName.submit();

from the child window right before the window.close() so that the user doesn't have to press any more buttons.

:)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top