Question

Signup Form In Four Pages

Asked by: mygoodtwin

I would like to build signup form that is broken into four steps. The first three pages collect the user data.
The final page displays the information that the user entered over the previous three pages. From here, there is an option to edit this submitted information.
I've done some searching, but am not clear of what is the best method of building the form to maintain the information from one page to the next in the signup process.
Along the way, I'd like to be able to check some content on the database --- such as verrifying that the entered data (such as a selected "username") does not already exist.

So is it adding info to the database from each page of the signup process. Or is all the data sent all at once when the user finishes the process (just before the final review submitted data page?)? But I'd like to be able to check that a username doesn't already exist (this is on the first page) before moving to the next step.

What is the best way to do this?

Thanks so much for your help!

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-05-26 at 17:56:24ID20626907
Topic

Active Server Pages (ASP)

Participating Experts
5
Points
130
Comments
16

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Multiple mailing list signup
    Hi Does anyone happen to have a javascript for handling signup for mutiple mailing lists (via checking 0 to many checkboxes)? Thanks Here's what I have: <!-- function signUp(frm) { var isError = false; var emailAddress = frm.Email.value; if (emailAddress == "...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: GaryC123Posted on 2003-05-26 at 19:31:50ID: 8587177

I would suggest adding the data to the database after each page is submitted and carry the new record ID thru the next pages so that you can then add the further data to the same record.

 

by: PLBSPosted on 2003-05-26 at 21:43:38ID: 8587639

Agreed.  If it is practial to do so, you can take all the data that should be unique in your database (such as username, possibly email address or full name if you don't want the same person to be able to sign up with more than one username, etc) and put all that on the first screen.  Then you can verify that against your database and either return a "duplicate" error or add a new record.  Then all subsequent screens' data can be added to the database with an SQL UPDATE...WHERE USERNAME = XXXXX

Your final screen could then display and allow edit for all data (except the username and any other unique data you took on the first screen)

Ask if you need help on the code...

 

by: ZakaliburPosted on 2003-05-26 at 23:11:28ID: 8587913

Try this (assume your 4 pages are named page1.asp , page2.asp, page3.asp, page4.asp)

Page1.asp
---
On page1.asp, say you have your form, with elements of (for example):
<input type="text" name="city">
<input type="text" name="state">
<input type="text" name="country">

Set the form for "action=page2.asp".


Page2.asp
---
On page2.asp, put the following code at the very top of your page, before any other asp code:
<%
city = Request.form("city")
state = Request.form("state")
country = Request.form("country")
%>

On page2.asp, say you also have some more form elements:
<input type="text" name="name">
<input type="text" name="age">
<input type="text" name="sex">

At the bottom of your form, just before the </form> tag, put the following code:
<input type="hidden" name="city" value="<%=city%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="country" value="<%=country%>">

Leave out the new elements from page2.asp as they will be passed on normally when you submit the form.

Set the form on page2.asp for "action="page3.asp".

What happens is when someone fills out the fields in page1.asp and hits the Submit button, the values will be carried over to page2.asp and stored in "city = Request.form("city")" etc, just as though you had entered them new on page2.asp.

Page3.asp
---
Now you'll need to include the form elements from not only page1.asp but also page2.asp.  At the top of the page before other asp code put:
<%
city = Request.form("city")
state = Request.form("state")
country = Request.form("country")
name = Request.form("name")
age = Request.form("age")
sex = Request.form("sex")
%>

On page3.asp, say you also have some more form elements:
<input type="text" name="hairColor">
<input type="text" name="eyeColor">

At the bottom of your form, just before the </form> tag, put the following code:
<input type="hidden" name="city" value="<%=city%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="country" value="<%=country%>">
<input type="hidden" name="name" value="<%=name%>">
<input type="hidden" name="age" value="<%=age%>">
<input type="hidden" name="sex" value="<%=sex%>">

Leave out the new elements from page3.asp as they will be passed on normally when you submit the form.

Set the form on page3.asp for "action="page4.asp".


Page4.asp
---
Now you'll need to include the form elements from not only page1.asp and page2.asp but also page3.asp.  At the top of the page before other asp code put:
<%
city = Request.form("city")
state = Request.form("state")
country = Request.form("country")
name = Request.form("name")
age = Request.form("age")
sex = Request.form("sex")
hairColor = Request.form("hairColor")
eyeColor = Request.form("eyeColor")
%>

I used Dreamweaver Ultradev to make my 3-page signup forms and I put the above code BELOW all the asp code at the top of the page, just above the <html> tag.  I've found Dreamweaver can be tempremental if it's above the server behaviors in this case (at least for me).

On page4.asp, you could put your fields for people to enter a username and password:
<input type="text" name="username">
<input type="password" name="password">

At the bottom of your form, just before the </form> tag, put the following code:
<input type="hidden" name="city" value="<%=city%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="country" value="<%=country%>">
<input type="hidden" name="name" value="<%=name%>">
<input type="hidden" name="age" value="<%=age%>">
<input type="hidden" name="sex" value="<%=sex%>">
<input type="hidden" name="hairColor" value="<%=hairColor%>">
<input type="hidden" name="eyeColor" value="<%=eyeColor%>">

Leave out the new username/password elements from page3.asp as they will be passed on normally when you submit the form.

Set the form on page3.asp for "action="page4.asp".

Now, in my case, since I used the "insert record" server behavior, all I had to was create a simple "signupComplete.asp" page to let people know their signup process was successful.  However, I also put the "check if username exists" server behavior on the page with the username/password fields, and some simple javascript to make sure people enter text in the fields and that the "password" and "confirmPassword" fields matched (confirmPassword field I set to "ignore" in the insert-record server behavior).

I hope that helps! :)
Jamie

 

by: ZakaliburPosted on 2003-05-26 at 23:15:43ID: 8587933

Please ignore the line: "Set the form on page3.asp for "action="page4.asp" which appears in the section for page4.asp.  I c&p'd some of the text and accidentally copied it as well :)

 

by: rambo1312Posted on 2003-05-26 at 23:22:28ID: 8588005

Hi there,

You must and only must save all the data on the last page only. This is because if the process is cut down by the user leaving 3 or 2 steps, there will be data in the database which is not Integral and will be garbage.

You move on step by step, passing the values of one form to another(Hint: using Hidden fields). And on the last page you can do all your validation relating to data in your database and then store all the data together using Transaction (First Rule of DB, ATOMICITY).

Imagine a normal case where user is working on the system and after completeing the 2nd step, the power goes off. There is no way that you can remove that incomplete data, but doing it all by yourself, which means Identifying the useless data first, verifying and the removing it with care. There could be a possibility that you provide the user to log back in and start from where he\she left. But, what if the user never turns up.

I've done this on a web site, and it is running successfully since October last year, and has generated a great deal of revenue, without any hassles and complaints from the users.

The website is www.ApplySchools.com

Click on "Application Form - Playschools" on the right menu. The registration process is divided in 4 steps. And all the activity relating to database is done on the last page.

Hope all this helps. In case of confusions, i may clear them.

Hope to hear,

Rambo.

 

by: sybePosted on 2003-05-27 at 00:42:13ID: 8588366

***
a often used method for signing up is to have a "basic" page with everything that you really need, like username, email and password.
The user can sign up using this easy page, and can fill out any other information  later (after logging in).

**
there are a zillion ways to temporarily store values
- session variables (you can even store a disconnected recordset in a sessionvar)
- textfile
- (temp) table in database
- pass everything as formvalues to the next page
- cookies

 

by: mygoodtwinPosted on 2003-05-27 at 05:30:48ID: 8589727

how do i carry the new record ID through to the next pages so that the additional data could be added?

 

by: rambo1312Posted on 2003-05-27 at 06:15:52ID: 8589991

hi mygoodtwin,

you could use this ..

On the page where you are creating the id.

<Input type="hidden" name="CurrID" value="<%=YourIDValue%>">

when you will submit the form data from this page, on the next page you can retrieve the id just as you would any other fomr field.

But my advice would be, that you should not create the ID before the last step. I still insist with my post. If you feel there won't be any such problem of user going off or not turning up then you may do it the way you are doing.

Hope to hear.

Rambo.

 

by: sybePosted on 2003-05-27 at 06:48:49ID: 8590218

first this:
I would never put a user's id in a hidden field. It's kind of an invitation to hackers. Better use Session Variables to keep track of such information.

for the rest:
Rambo's idea is good and should work. But it's not the only solution.
There's only one thing against Rambo's solution, and that is that you have to pass all filled out formvalues from page 1 to page 2. On page 2 some more info is added, and you need everything transferred to page 3 etc. This is not always a problem, but it might be a problem, when the user has to write some larger texts everytime. And it will be really a problem if you have some file-upload in one of the pages.


>> there will be data in the database which is not Integral and will be garbage.
Well, yes and no. The garbage-data can be removed easily if you use some simple solutions.
- store the temporary data in a temporary table. If the user finishes, then put all data in the real table, and remove it from the temporary table.
You know that you can always remove all data from the temporary table which are older then 1 hour.
- store data in the "real" table, but have a flag set when everything is completed. Again now you can easily detect which data can be removed.


 

by: rambo1312Posted on 2003-05-27 at 06:52:48ID: 8590247

Bang on sybe!!!

thats a good reply pal :)

so now Mr. mygoodtwin, you have ample options and ample clarity amongst them to choose the best one.

so just go ahead and leave the rest to the experts hanging around here.

hope to hear some more from you whil solving it.

Rambo.

 

by: mygoodtwinPosted on 2003-05-27 at 09:38:09ID: 8591604

wow.
ok. in this form there are text fields where the user can enter some personal text. also i'd like to make it possible for the user to upload a picture at some point -- probably on the first page. it's probably a bad idea to carry this stuff along from page to page. and some things have to be checked against pre-existing data to prevent duplicates (such as a user-created username and their email address).

so i'm thinking it's probably best to store the data from each page to the table but have a flag set for when everything is completed.

does this make sense? the first page of the form will create a new row in the table -- it will check for data that should not have duplicates (the user-created username and their email address). the next page will update the columns that are empty (since this is not collected from the first page). the next page will update the remaining missing info (that which was not collected in the first two pages). after this, the flag will verify that all the required info has been entered before making this a valid complete entry.

i don't even know how to set a flag --- but i s'pose i can find this (does anyone know of a good site with info on this?).

so many options... but i think i'm narrowing it down...

 

by: rambo1312Posted on 2003-05-28 at 05:08:16ID: 8597242

cheers to all!! :)

 

by: PLBSPosted on 2003-05-28 at 05:17:42ID: 8597303

Thanks for the points...

Simplest way to set a flag would be to use a boolean (true/false), or in Access, "Yes/No" field.  I know in Access, and I believe in MS SQL, that the default value for that field when you create a new record is False (No).  Of course, you can specify the default for that field in your database just to be on the safe side.  Then, when the user completes the application, you can set the field to True (Yes).  

Some issues you'll probably run into:

Sybe's points about cleanup of old, incomplete records.  As s/he said, easy to do.  Unless you don't have server access rights to create scheduled tasks... (i.e. shared server/hosting service).  Plenty of posts on here about how to handle scheduled tasks in that situation... most seem to end up writing some code to handle the cleanup, then sticking that code on some page that you know will be accessed fairly often.  Not the ideal solution, but it can work.

Uploading a picture.  Can be a headbanger for several reasons:
- Have to have either a server-registered component (purchased, requires $$$ and server admin rights) or an ASP component (free, doesn't have to be registered).   I've used psUpload with success.  
- You can control the file size, type, name, path, etc. of the file that is actually SAVED to the server HDD, but you can't control it on the client side.  Meaning... the client can select a ridiculously huge file to try to upload, and the file will be transmitted in its entirety as a bitstream... and only then can your script evaluate it and decide whether or not to save it.  That can really tie up bandwidth/server resources, and can cause your script to timeout (use  Server.ScriptTimeout = 360 or whatever time you choose to extended the default max for timeout).  There's really no practical workaround for that, so you just have to accept it.  There are ways in JavaScript and ActiveX to check or limit file size/type on the client side BEFORE the upload, but they are extremely unreliable (they depend on client folder access rights, which are nothing you should depend on... basically not even worth the trouble to implement).
- When posting the file upload bitstream, you'll have to set the form to encType = multipart/form-data to pass the actual file rather than just the filename.  Unfortunately, that prevents you from passing input field values at the same time.  In other words, you can't have a file upload on the same form as other data.  (well, there is a cumbersome workaround... see your upload component's instructions).  You CAN have the upload and the data on the same PAGE easily, just not the same FORM... so you'd have to have a form for the data, with it's submit button, then the upload form, with it's own submit.  Sloppy, though... the simplest way is to put the picture upload on its own page.  Also tons of posts on here about uploading.

Best of luck!

 

by: rambo1312Posted on 2003-05-28 at 07:04:06ID: 8597989

Hi mygoodtwin,

Firstly dont go by literal meaning of Flag, it is no Special Field.

Just add another field to your table with the name Flag_Complete. The Datatype will depend on the Database you must be using. If it is Sql Server you could use BIT type which only stores 1 or 0. A value of 0 would mean the data is incomplete and set it to 1 if it is verified to be complete. In MSAccess there is a field Boolean. You may use it but it takes more bytes than a BYTE field. BYTE if you find it your datatypes will be the best option available for a Flag type field.

Hope to hear,

Rambo.

 

by: mygoodtwinPosted on 2003-05-28 at 07:18:09ID: 8598111

Thanks, PLBS.
i'm having trouble passing info on to the second signup page. what happens is the user clicks the "submit" button, then the data is collected (after it's been checked for correct input) and sent to the database. then the page is redirected to the second page:
 Response.Redirect "signup2.asp"
but on the second page, it seems to lose the username. i added:
<% Response.Write "The username just entered was " & (ProfileName)" %>
ProfileName is the column for the textbox "User" on the form.

but when it goes to signup2.asp, it shows the text "The username just entered was" but doesn't show the data from the ProfileName column that was added on the first page.

i then tried adding "signup2.asp" to an action tag in the form. this passes the username, but when i look at the datatable, it hasn't added a new row.

so i guess my question is on the second page, how do i access the the info for the data that the user just entered? my plan was to get the username (since the username will be unique for each member) and say update the info where the ProfileName is "User". and then update the data that is collected on this page. and then the same for the third page. does that make sense at all?

i'm using sql, so you're saying that i should enter an additional column --- something like "complete" with a bolean that will be set to true once the signup process is complete.

as far as uploading a graphic... i'll handle that later. but i understand now that this should be placed on a separate page. one headache at a time, though. my first goal is to get this signup process completed.

this is all new to me, but exciting and fun.

thanks so much for your help -- i'll have more points to give out once they are added to my account (i've signed up, but have not yet received the points).

--mygoodtwin--

 

by: PLBSPosted on 2003-05-28 at 19:18:50ID: 8602764

Welcome to ASP!  
One thing to remember about ASP scripts is that they start off clueless by default.  When you invoke a script, whether it's from a <a href=  link, from a Response.Redirect, or from a form action tag, the script begins executing with absolutely no idea about anything.   So, whenever you create a script, just remember that if the script requires any data, values, etc., you have to provide a way for the script to get them.

In your case, you've created Pg1 of your signup, which includes a form.  That form has an action= tag, and the action tag tells what script to go to once the form is submitted.  As you've already seen, when the "processing" script begins, it doesn't immediately have all the data from the form... you have to load that data via the Request("xxxx") statement.  You can then have the script write that data to your database table.

Well, once that's done and you Response.Redirect to your second page, that second page starts off clueless.  You want Profilename to contain the User ID, but you'll have to load that... the script doesn't know anything that happened before it began.  

You have to continue that process as you hop from script to script... any time a script needs any data at all, you have to make sure it is provided to it.  There are many ways to do this...

*** Pass the data in the URL

At the end of the script that processes the 1st page and creates the database record, you can:

Response.Redirect "signup2.asp?ID=" & ProfileName
(assuming that ProfileName is a variable that you have declared and contains the value of the Username)

or...
Response.Redirect "signup2.asp?ID=" & Request("User")
would do the same thing, assuming that User is the name of the textbox on the P1 form.

Then, at the beginning of your signup2.asp script, you'd put

Dim strUser
intUser = Request("ID")

What you're doing is actually including the data within the URL of the Response.Redirect.  The format is:

URL?key1=value1&key2=value2&key3=value3

So in your case, the Response.Redirect would pass the URL:

signup2.asp?ID=MYGOODTWIN   or whatever ID the user created

This approach is very straightforward, it's easy to debug because you can actually see the data in the URL at the top of the browser.  Drawback... anyone else can see the data in the URL at the top of the browser.  Call it an invitation to hackers.
But it's easy to implement, so you'll see data passed that way quite often when it's not sensitive (look at eBay, Google, etc.  Not ASP, but the same idea... when you get search results, look at the URL)

*** Store the data in cookie(s)

Also simple.  In your processing script, after you've checked to make sure the ID is unique and added it to the database, use:

Response.Cookies("User") = ProfileName
(assuming ProfileName is a variable you've declared and loaded with the username)

or

Response.Cookies("User") = Request("User")
(where Request("User") pulls the value of the User text box from the form)

Then, in your P2 script, use

Dim strUser
strUser = Request.Cookies("User")

*** Store the data in a Session variable

Similar to cookies.  Actually, the Session object is kind of like a continuously maintained cookie.  Each user has a unique cookie, and you can store data by:

Session("User") = strProfileName
(where strProfileName is your variable that holds the user name)

Then, in your Page2 form, you can use Session("User") to query the database or perform and Update query

The thing about Session variables is that they time out... the default is 20 minutes.  So, if the user is in the middle of signing up and goes away for half an hour, when they come back their session variables will be gone.  Of course, you can change that timeout value if you want.


Hope that helps!!!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...