Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2006, 06:42 AM
Authorized User
 
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple page form

Can anyone help?

I have a form with multiple asp pages. The first page is an input page where you enter name, department etc. You then select click a hyperlink to another page where you input scores in text boxes.
I want to be able to submit all the data from both pages into one record in an access database.

I have no problem submitting data to access. The problem is retaining the data on the second page when you click back and go back to the previous page and then click the submit button to submit all the data entered on both pages.

I am a novice to asp and vbscript.
Does anyone know a script that can be used to accomplish this??

Would be greatly appreciated.

Jayman

 
Old January 30th, 2006, 08:55 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii jayman!!
either
1>you can go for nested form work fine for IE.
but not in Other Browser plz refer. http://www.scss.com.au/family/andrew...s/nestedforms/
2>or using hidden form fields and javascript you can post all the data into start page ,then transfer the resulting page.
e.g , firstpage.asp contains all the forms.
    use javascript to hold all the form fields into separate/single form fields/field and change the behaviour of all the form submit button so that a click on any of the form post ,all the data into process.asp page from where user transfer method to subsequet asp pages that will process their relevant data.

Hope this will help you


Cheers :)

vinod
 
Old January 30th, 2006, 06:27 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;I have a form with multiple asp pages

I assume you have multiple pages each with a form on them?

;;;I want to be able to submit all the data from both pages into one record in an access database.

I am not trying to change your design plan however placing all this information on the one page will eliminate your 'clicking back button' problem - Is this an option?

;;;The problem is retaining the data on the second page when you click back and go back to the previous page and then click the submit button to submit all the data entered on both pages.

This is not possible. If the second form is not submitted its values can not be carried back to the first page. Doesnt your first page form submit to the second page? If they click back from the second page, change details (on the first page) and click submit, they will end up back at the second page? So your problem is:
If this happens you loose the values on the second page??

IMO try no to use a browser dependent solution - There are other ways. Depending on your answer to my questions I would be tempted to use a temporary table to store information entered in each step. Then if the user bugs out before the end, remove the info from the temp table else activate it.


Wind is your friend
Matt
 
Old January 31st, 2006, 05:15 AM
Authorized User
 
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Matt,

Thanks for your quick repsonse.

My problem is that the first page has hyperlinks to all the other pages. To use the form you enter name, department,etc on the first page. then click a hyperlink to another page to fill out scores for an application e.g MS word for Beginners.

You are right each page is it's own form.

Then if you decide you need to fill out another form on another page say MS Excel for Intermediate. you need to go back to the first page to click a hyperlink to get there. Basically the first page is not supposed to submit to the second page or any other pages.

Someone said suggested using hidden fields or querystring with a loop.But as i am a novice to asp and vbscript i havent got a clue how to do this? I normally work on examples of script and work my way from there ;)

Jayman







Quote:
quote:Originally posted by mat41
 ;;;I have a form with multiple asp pages

I assume you have multiple pages each with a form on them?

;;;I want to be able to submit all the data from both pages into one record in an access database.

I am not trying to change your design plan however placing all this information on the one page will eliminate your 'clicking back button' problem - Is this an option?

;;;The problem is retaining the data on the second page when you click back and go back to the previous page and then click the submit button to submit all the data entered on both pages.

This is not possible. If the second form is not submitted its values can not be carried back to the first page. Doesnt your first page form submit to the second page? If they click back from the second page, change details (on the first page) and click submit, they will end up back at the second page? So your problem is:
If this happens you loose the values on the second page??

IMO try no to use a browser dependent solution - There are other ways. Depending on your answer to my questions I would be tempted to use a temporary table to store information entered in each step. Then if the user bugs out before the end, remove the info from the temp table else activate it.


Wind is your friend
Matt
 
Old January 31st, 2006, 06:49 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I wont sit here and knock the design process of your pages however I would do things different. Have you thought of a intuative step 1, step 2, step 3.... process? Anyhow Im not here to write code for people either - assist those with specific problematic pieces of code, yes.

Any way this may help you. You can use JS to make any hyperlink submit a form and or hidden form fields but you can not disable the back button in the browser (some may say you can. I have never seen it working accross the common browsers/versions)

<a href="#" title="Click to..." onClick="javascript:formName.submit();">Link Txt </a>

You can replace:
onClick="javascript:formName.submit();">
With:
onClick="someName();">
and re assign the action property to submit to different pages depending what link is clicked:

function someName()
{
   formName.action = 'pageName.asp';
   formname.submit();
}

Wind is your friend
Matt
 
Old February 7th, 2006, 06:13 AM
Authorized User
 
Join Date: Jan 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I decided to put all the pages together in one page form and create an anchor link to each part of the page. So it looks like each part of the form is part of a separate page.
When the user clicks on an anchor link it takes them to a specific part of the page that looks like a whole new separate page.
This way you can submit from any part of the one page form and get multiple results in the access database.

Thanks for your help anyway.

Jayman






Quote:
quote:Originally posted by mat41
 I wont sit here and knock the design process of your pages however I would do things different. Have you thought of a intuative step 1, step 2, step 3.... process? Anyhow Im not here to write code for people either - assist those with specific problematic pieces of code, yes.

Any way this may help you. You can use JS to make any hyperlink submit a form and or hidden form fields but you can not disable the back button in the browser (some may say you can. I have never seen it working accross the common browsers/versions)

<a href="#" title="Click to..." onClick="javascript:formName.submit();">Link Txt </a>

You can replace:
onClick="javascript:formName.submit();">
With:
onClick="someName();">
and re assign the action property to submit to different pages depending what link is clicked:

function someName()
{
formName.action = 'pageName.asp';
formname.submit();
}

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing PDF (page x to y) / multiple page seq's robbert XSLT 1 November 13th, 2006 10:27 AM
Multiple filter on a form chimp Access VBA 0 September 9th, 2004 02:59 AM
One form in multiple instances. Sink Access VBA 0 June 7th, 2004 04:25 AM
Multiple Form Instances in a single form? gman997 ASP.NET 1.0 and 1.1 Basics 1 March 30th, 2004 06:46 PM
multiple form action jack1234 JSP Basics 1 June 8th, 2003 01:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.