Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I Display a Window with No Exit Except My Continue Button?

Status
Not open for further replies.

BigglesDad

Programmer
Aug 6, 2003
9
US
The page contains code that writes a record to the database using data from a form on the previous page. The process requires that the user clicks [Continue] so that the next part of the process gets done. I need to prevent exit from this page by any means except the [Continue] button. How can I do this?
 
You can't


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Nope


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You need to track 'partially completed transactions' and clean them out of your database periodically, if need be.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hi

traingamer said:
You need to track 'partially completed transactions' and clean them out of your database periodically, if need be.
Why not to keep them on the session until all data is collected ? Less database operations, automated cleanup.

Feherke.
 
OK. It can't be done. What about the "on click" facility? - - - Is it possible to use it to get a piece of ASP code to run so that the database insert would happen between the submit button being clicked and the form action taking place?
 
I use a mish-mash of vbscript and java to give a message if a particular button is not pressed.
 
Is it possible to use it to get a piece of ASP code to run so that the database insert would happen between the submit button being clicked and the form action taking place
ASP code runs on the server. By definition, it only runs once the page has been submitted.

Perhaps you can take a step back and describe the whole process? It appears that you have an initial form which the user submits, a second form is sent in return, and you want to make sure the user submits that rather than banging out halfway.

If that's the case, my suggestion would be that when the script processes the first form, it doesn't do anything with the values input except output them in the second (and subsequent) form(s) in <input type="hidden"> elements. Only when the last form is submitted, with all the data entered, do you actually write anything to the database.

That's a pretty low-tech solution, but may do the trick for you. Failing that there are cleverer ways to "save state" between iterations of a form. I don't speak asp, but this looks like a place to start:
Either way the approach is the same - build up the data over as many forms as you require, but only do something with it at the very end.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Chris, You said, "Perhaps you can take a step back and describe the whole process?" OK.
Page 1 collects firstname, lastname, email and sends the data via POST to page2.
Page 2 ASP checks the data for prior entry in the database, creates an appropriate nickname and the fullname, creates a database record if this is a new user and sends the data plus the values from several more hidden fields to an autoresponder via POST.
The autoresponder sends a validation email to the given email address and returns the user to page 3.
Page 3 is no more than a 'please click the link in the email when you get it' and a goodbye.
When the user clicks the link in the received email, they are returned to another page where their database record is displayed and they are invited to complete many other fields for their total profile.
We now have some clever person who wants to iritate us many times a week by completing page 1 with rubbish and just bombing out when page 2 displays. So we get a rubbish record every time.

Whew! That's the overview and the reason for looking for a simple way round it. I have another strategy in mind but it will need a significant amount of code re-write. Obviously, I'm lazy!
 
We now have some clever person who wants to iritate us many times a week by completing page 1 with rubbish and just bombing out when page 2 displays. So we get a rubbish record every time.
You say that you get a "rubbish" record in the database yet from your quotes above, you say that all page 1 does is "collects firstname, lastname, email and sends the data via POST to page2". So how is this database record being created from page 1 when it doesn't get written until page 2 completes?

Anyway, the best solution is just what ChrisHunt decribed above (post the data from one page to another until you are happy with it all - only then do you write anything to the database).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I say you should check the incomming data anyway, for inappropriate content so create a 'list all new files and delete if unsuitable'.
Is this a person or a crawler entering your site, some of the crawlers are very clever? Add a security field to your input, in the form of an image containing a letter sequence.
I would make it all one form, if the people are serious about their intentions, they will take time to fill the form in. The crawlers will not be able to read the picture. Might be worth offering them a basic form, containing the data you need but not all their details and have them update their profile when they enter the site but 1 form is vital (IMHO) or multiple forms carrying data and not being submitted.

Keith
 
Thanks to all who have responded - your inputs are appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top