Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Multi page forms

New Here ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

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.
TOPICS
Server side applications

Views

442
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

"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
----------------------------


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

Can you elaborate on the mysql_insert_id function? are there any examples? sounds like what I am looking for.

Thanks,
Mark.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

Would you use the same method in ASP VB?

Thanks,
Mark,

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 06, 2006 Sep 06, 2006

Copy link to clipboard

Copied

sorry, i really have nothing on asp. i am sure that it has something like this though.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2006 Sep 07, 2006

Copy link to clipboard

Copied

Use can create a SQL statement that uses @@Identity to grab the last created
record. However the issue that you will run into is that such methods fail
if you have a lot of people entering at the same time.

If you are using ASP, it may pay to have a look at ASP.Net. In that language
form values are held in what is called viewstate, and there are controls
built in like the Wizard that are specifically designed for multi page
forms.


--
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:ednmqo$dv3$1@forums.macromedia.com...
> Would you use the same method in ASP VB?
>
> Thanks,
> Mark,


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 08, 2006 Sep 08, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 10, 2006 Sep 10, 2006

Copy link to clipboard

Copied

LATEST
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.
>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines