Skip to main content
Participant
September 6, 2006
Question

Multi page forms

  • September 6, 2006
  • 4 replies
  • 473 views
Can any one tell me the best way to create a multipage form?
Rather than have one long form I would like to spead it across 2 or 3 pages then insert the collected data into a database table, then show all the collected data to the new user.
Any weblinks to tutorials or advice is appreciated.

Thanks,
Mark.
This topic has been closed for replies.

4 replies

Inspiring
September 11, 2006
It is better to use a SQL statement like

Select @@Identity as NewUser
From tblLogin

to grab the newly created UserID number. This is a better approach as it
lessens the risk that you will have two users register at roughly the same
time and grab the wrong ID.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"M@rk" <webforumsuser@macromedia.com> wrote in message
news:edrhkm$3d1$1@forums.macromedia.com...
> Ideally I'd like to stick ith ASP VB and Access as I've done most of the
> site
> using this.
> Just really trying to register a user details across two pages instead of
> one
> long one using the built in DW server behaviors.
> On the first page I register the Username and password which populates the
> database table
> tblLogin
> UserID
> Username
> Password
>
> Then on the second page I'd like to collect their details and insert the
> newly created UserID from the previous page and insert into another table
>
> Details
> DetailsID
> UserID
> Name
> Address
> Address_2
> County
> Postcode
> Tel
> Email
> Website
>
> Really could use some help ,at the moment I am using a recordst on the
> second
> page which uses SELECT MAX(UserID)
> FROM tblLogin to add the last UserID to a hidden field.
>
> Whilst it works I'm not entirly sure its the best way.
>
>
> Thanks,
> Mark.
>
>
>


M_25Author
Participant
September 8, 2006
Ideally I'd like to stick ith ASP VB and Access as I've done most of the site using this.
Just really trying to register a user details across two pages instead of one long one using the built in DW server behaviors.
On the first page I register the Username and password which populates the database table
tblLogin
UserID
Username
Password

Then on the second page I'd like to collect their details and insert the newly created UserID from the previous page and insert into another table

Details
DetailsID
UserID
Name
Address
Address_2
County
Postcode
Tel
Email
Website

Really could use some help ,at the moment I am using a recordst on the second page which uses SELECT MAX(UserID)
FROM tblLogin to add the last UserID to a hidden field.

Whilst it works I'm not entirly sure its the best way.


Thanks,
Mark.

September 6, 2006
one way to do this if a multitab form does not work for you is break your data entry into logical sections. then, process each section in the head of the next page. the key to this approach is making sure that you set up your pages in order of importance.

like this:
page 1 ->login info: username, email, password
page 2 ->contact info: address, phone, etc
......................

this way with the data on page one you create an account for the person.
after you insert this data use the mysql_insert_id function to get the new users id. then you can maintain state through the rest of the forms by either setting a session variable or setting a hidden form control to their id.
M_25Author
Participant
September 6, 2006
Can you elaborate on the mysql_insert_id function? are there any examples? sounds like what I am looking for.

Thanks,
Mark.
September 6, 2006
after you insert the new user (into the database) you use the mysql_insert_id function to get the last id that was inserted into the database.

http://us2.php.net/mysql_insert_id
Inspiring
September 6, 2006
"M@rk" <webforumsuser@macromedia.com> wrote in message
news:edmagm$k1j$1@forums.macromedia.com...
> Can any one tell me the best way to create a multipage form?
> Rather than have one long form I would like to spead it across 2 or 3
> pages
> then insert the collected data into a database table, then show all the
> collected data to the new user.
> Any weblinks to tutorials or advice is appreciated.

You may consider using a multi-tab form instead:
http://www.olimpo.ch/tmt/tag/tabs/sample_form.cfm

This make the server-side programming much easier.

The example above is generated using ColdFusion, but you can easily grab the
relevant JavaScript code or find many alternatives.

Not sure if such a solution fits your needs, but it's worth a look.


--
----------------------------
Massimo Foti
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com
----------------------------