Clearing values from variable when form proccesses ??

R

Robin

Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""

Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert????
Thanks for any suggestions!!
 
R

Ray at

Change your page logic:

form.htm: posts to page.asp
page.asp: Processes form submission and has NO html. Redirects to
thanks.htm
thanks.htm: <html>Your record was inserted</html>

Ray at work
 
A

Alexey V.Zelenin

Ray at said:
Change your page logic:

form.htm: posts to page.asp
page.asp: Processes form submission and has NO html. Redirects to
thanks.htm
thanks.htm: said:
Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""

Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert????
Thanks for any suggestions!!

I think you can avoid creating the "thanks.htm" page by using this
technology:

1. User is on the page "form.asp"
2. He fills the form and sends it
3. System checks if "vMemo" is not empty
4. If it is not empty - inserts value
5. System calls
Response.Redirect( "form.asp?updated=yes" )
6. Else (if "vMemo" is empty) System checks if Reqest("updated")="yes"
7. If it equals, show the thanking message
8. Show the form and whole page if needed

If user presses f5 at this time, he will recieve again the thanking
message, but nothing will be inserted into database again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top