469,351 Members | 1,814 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,351 developers. It's quick & easy.

Clearing values from variable when form proccesses ??

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!!
Jul 19 '05 #1
2 2707
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

"Robin" <rd***@hotmail.com> wrote in message
news:d7**************************@posting.google.c om...
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!!

Jul 19 '05 #2
Ray at <%=sLocation%> wrote:
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>
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.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Ron Vecchi | last post: by
2 posts views Thread by Ramez T. Mina | last post: by
6 posts views Thread by Sanjay | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.