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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query transactionID using urltoken???

Status
Not open for further replies.

tina2

IS-IT--Management
May 1, 2001
169
0
0
US
I have a series of forms that I would like to enable the user to come back and modify using a unique transaction ID.

Here is the scenario:
1. User fills out part 1, which writes to a database and creates a unique random ID number.
2. In Part 2 I would like to query the database and put the ID number into a session variable for the rest of the form. My first thought was to write the URLtoken to the dtabase and use that to get the ID.

It works, but am I crazy? Is there a better way?

all suggestions are welcome!
Kristine
 
Kristine,

I will try to make an asumption and if I am incorrect please correct me.

You have multiple forms on multiple different webpages that a user would fill out and submit into the database all within the same session. If in your buisness rules/logic, you do not want incomplete forms lingering around in the database I would do this.

1. create a strucutre of all the form fields that are contained in the multiple forms and store it in a session variable. Intiallize them all to "".

2. when displaying each of the forms, have the default value of each of these form elements display the session variable from the struct for that form element.

3. On submission of each page update the session structure and not the db with the value of the form fields.

4. Give a final approval page that allows the user to go back and correct any of the forms the user wants.

5. submit to the db all of the values that are in the struct session.


Using this way is a great way to reuse your forms for submit and edit. So if the users comes back and is in another session, you can query the db and take those results and fill in the session structure and use the same forms without changing any code. (in theory)


this is how I do it and find it is very easy to maintain multiple forms.

jgroove
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top