CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Multi-Page Form - Please Help

Print topic Send  topic

Author Message
rmucb
Posted: 12/18/2003, 1:40 PM

Hi All,

I have been reviewing all information available here for a while now and it has been a big help. Unfortunately, I ran into a wall with something I am not sure how to do it, even though I know it has been done. I know the question has been answered here many times and I apologize, but to be honest for all the stuff that I read, I am just not getting it.

I am running MySQL/PHP and have referenced the following article:
http://www.gotocode.com/art.asp?art_id=80&
Along with tons of related postings.

I want to create a multi-page form, but I am still unsure how it is done.

Simple table example:

ms_id (pk auto incremented)
ms_data1 (on form page1)
ms_data2 (on form page2)
ms_data3 (on form page3)

I know that a new record can be created with ms_id and ms_data1 on page1. Following the insert of page1 I want to continue to do updates of ms_data2 and ms_data3 on page2 and page3 respectively.

I know that on page1 you add in the custom code on After Insert, as detailed in the above article. I know that ms_id needs to be passed to page2 and page3 for the record to be updated.

What I am not understanding is exactly where/how the ms_id parameter is passed (through URL, session variable, etc.). While all of the above make perfect sense to me, I am at a loss with the final piece of how to pass the parameter. Any help would be immensely appreciated.

(I swear, I have read tons of postings, I am just not getting it !!! Argh !!! Happy holidays everyone !!!)
jeangau
Posted: 12/18/2003, 4:17 PM

I believe you might find the answer in the CCSExamplePack

http://docs.codecharge.com/studio/html/ProgrammingTechn...lePack.html?toc

and look for the "Multi-step user registration form"

rmucb
Posted: 12/18/2003, 10:59 PM

Thanks for the reply. I have looked at the Multi-Step Registration form. That does something similar but it is incompatiable with what I want to do. I think the example pack was setup to work with the included accessdb. It was keyed to follow a "user_id" parameter, not to identify the autoincremented primary key and pass that to the next page. Thanks for the reply though. =)
Darren
Posted: 12/19/2003, 3:31 AM

Put this code into the 'After insert' event of the first form.

---
Dim LastID

'Get ID of asset just created (could be a problem if multiple users inserting)
LastID = CCDLookUp("max(PrimaryKeyId)","TableName","", DBConnectionName)
'Update redirect statement (Redirect is a global function)
Redirect = Replace(Redirect, "?", "?PrimaryKeyId=" & LastID & "&")
---

Note that you can replace max(PrimaryKeyId) with @@IDENTITY for SQL Server

NOTE: THE REDIRECT WILL ONLY WORK IF YOU DO NOT SET A RETURN PAGE FOR THE MAIN FORM!!!! You must set the redirect for the buttons individually.

Darren.
rmucb
Posted: 12/19/2003, 1:47 PM

Darren,

Thanks for the code, though, if I am not mistaken, that is for ASP and SQL ??? I am working with PHP and MySQL. Is there something similar that can be done ??? Thanks for the reply.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.