Experts Round Table Network
Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:
Password:
Remember me
Forgot your password?
Register
post form to itself
Welcome,
Guest
. Please
login
or
register
.
December 02, 2008, 09:57:26 AM
11304
Posts in
1248
Topics by
498
Members
Latest Member:
katCheeme
Home
Help
Search
Login
Register
Experts Round Table Network
|
Serverside Technology
|
ASP
|
post form to itself
« previous
next »
Pages:
[
1
]
Print
Author
Topic: post form to itself (Read 526 times)
Johnny26652
Offline
Posts: 61
post form to itself
«
on:
July 18, 2007, 04:33:54 PM »
i am having trouble posting the form to itself. Any one has suggestions doing it the best way..when user is refreshing the page the form is posting again(the second time). how can i avoid it? thanks.
the asp form results are not in a database
John
«
Last Edit: July 18, 2007, 04:40:14 PM by Johnny26652
»
Logged
Johnny
rdivilbiss
Moderator
Offline
Posts: 414
Re: post form to itself
«
Reply #1 on:
July 18, 2007, 04:52:42 PM »
http://www.rodsdot.com/ee/progess_bar_form_handler.asp
is a possibility, but I have an article more specific to this I am looking for.
«
Last Edit: July 18, 2007, 04:54:34 PM by rdivilbiss
»
Logged
Rod
rdivilbiss
Moderator
Offline
Posts: 414
Re: post form to itself
«
Reply #2 on:
July 18, 2007, 05:20:05 PM »
I must have had a brain fart....this is easy.
if request.servervariables("HTTP_METHOD")="POST" then
' process the form post
else
' the first time on the form, or a page refresh, fall through to the form.
end if
If you want to validate the form, before processing it, and may have to redisplay the form with the values submitted, you add....
if request.servervariables("HTTP_METHOD")="POST" then
' process the form post
' retrieve and filter all the input
' verify the data is correct for submission - e.g. to a db or to an email
if (valid_data) then
' do the db insert, update or e-mail, whatever
response.redirect('success.asp')
else
' fall through to the form
message = "Please fix the errors"
end if
else
' the first time on the form, or a page refresh, fall through to the form.
end if
Then in the HTML
<form>
<%
if message <> "" then
response.write "<p>"&message&"</p>"
%>
<input name="field1" value="<%=filtered_and_safe_posted_field1%>
etc.
Which, by the way, is how I decide whether or not to show the progress bar in the link above...which you should only need for a really slow processing page.
Logged
Rod
Johnny26652
Offline
Posts: 61
Re: post form to itself
«
Reply #3 on:
July 18, 2007, 05:45:51 PM »
i have a poll form/poll results in the same form. when a user submits his choice the poll results will be updated.
is it possible to have both form and results shown in the same page and prevent submit if the user refreshes the form..
Rod,
How are able to disable the back button?
thanks
«
Last Edit: July 18, 2007, 06:03:09 PM by Johnny26652
»
Logged
Johnny
rdivilbiss
Moderator
Offline
Posts: 414
Re: post form to itself
«
Reply #4 on:
July 18, 2007, 06:37:39 PM »
You can't truly disable the back button, and I'm writing your poll-vote script as I post.
Logged
Rod
Pages:
[
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
ERT 1.5
-----------------------------
=> Round Table Learning Center
=> Bug reports
-----------------------------
Legacy
-----------------------------
=> The next level
=> History of ERT
-----------------------------
Community Affairs
-----------------------------
=> Introductions
=> Ballot Box
===> Closed Polls
=> Soapbox
=> Propose and Consult
===> Propose and Consult...CLOSED
-----------------------------
Bits and Bytes
-----------------------------
=> Tips, Tricks, Snippets, Tidbits And General Pearls Of Wisdom
-----------------------------
Serverside Technology
-----------------------------
=> PHP
=> ASP
-----------------------------
Webservers
-----------------------------
=> Apache
=> IIS
-----------------------------
Databases
-----------------------------
=> MySQL
=> Access
=> MS SQL Server
-----------------------------
Clientside Technology
-----------------------------
=> HTML
=> CSS
=> Javascript
=> Flash
=> WAP/WML
-----------------------------
Web Technologies
-----------------------------
=> General Web Dev
=> Web Standards
=> XML
=> Online Marketing
-----------------------------
Graphics
-----------------------------
=> Graphics Design and Animation
-----------------------------
Programming
-----------------------------
=> .NET
=> JAVA
=> MS DOS Batch Scripting
=> Mathematics
=> C & C++
=> VB
=> Delphi
=> Algorithm design
-----------------------------
Operating Systems
-----------------------------
=> Windows (General)
=> NT Based (2K, 2K-03, NT, XP, Vista)
=> Open Source (All)
-----------------------------
Hardware
-----------------------------
=> Hardware General
=> Gamers Hardware (Advanced)
-----------------------------
Networking
-----------------------------
=> Home (small)
=> Office (large)
=> Internet
-----------------------------
Security
-----------------------------
=> General Security Issues
-----------------------------
Rants/Opinions/Proposals
-----------------------------
=> Site operation
Powered by SMF 1.1 RC2
|
SMF © 2001-2005, Lewis Media
Joomla Bridge by
JoomlaHacks.com