Hidden input Form , response.write not working

C

chumley

I have a javascript history object (javascript:history.go(-1)) that
goes back to previous page when I trigger a button event to go back to
that last page :
<form action="javascript:history.go(-1)" method="post">
<input type="hidden" value="yes" name="awc" id="awc">
<input type="submit" value="BACK">
</form>

...but doing a test to response write to see if it's posting to the
previous page:
if request.form("awc") = "yes" then
response.write "yes "'
end if

....I do not see the "yes" displayed. wondering if combining this
javascript object with this simple ASP is valid, tho it looks like it
should be. Even doing method="get" , I don't get my "yes" display :-(

??
chumley
 
D

Dooza

I have a javascript history object (javascript:history.go(-1)) that
goes back to previous page when I trigger a button event to go back to
that last page :
<form action="javascript:history.go(-1)" method="post">
<input type="hidden" value="yes" name="awc" id="awc">
<input type="submit" value="BACK">
</form>

..but doing a test to response write to see if it's posting to the
previous page:
if request.form("awc") = "yes" then
response.write "yes "'
end if

...I do not see the "yes" displayed. wondering if combining this
javascript object with this simple ASP is valid, tho it looks like it
should be. Even doing method="get" , I don't get my "yes" display :-(

Your page won't submit the form data, as your using Javascript to
effectively press the back button. I would use a session variable on the
previous page, call it previous page. Define it as
Request.ServerVariable("SCRIPT_NAME"), then set your action to your form
as the session variable.

Dooza
 
A

Adrienne Boswell

Gazing into my crystal ball I observed chumley <[email protected]>
writing in (e-mail address removed):
I have a javascript history object (javascript:history.go(-1)) that
goes back to previous page when I trigger a button event to go back to
that last page :
<form action="javascript:history.go(-1)" method="post">
<input type="hidden" value="yes" name="awc" id="awc">
<input type="submit" value="BACK">
</form>

..but doing a test to response write to see if it's posting to the
previous page:
if request.form("awc") = "yes" then
response.write "yes "'
end if

...I do not see the "yes" displayed. wondering if combining this
javascript object with this simple ASP is valid, tho it looks like it
should be. Even doing method="get" , I don't get my "yes" display :-(

??
chumley

ASP has no idea about what's happening on the client, so would never get
that information.

By the way, you're reinventing the wheel. There is a back button on the
user's browser, as well as a handy dandy backspace key that does the same
trick, not to mention the mouse gesture, should the client be so enabled.

There is another suggestion in this thread about using session variables.
That can work, but I prefer to explicitly state the name of the file for
the action attribute, or better yet, have the form submit to itself.

YMMV
 
E

Evertjan.

Adrienne Boswell wrote on 05 mrt 2010 in
microsoft.public.inetserver.asp.general:
By the way, you're reinventing the wheel. There is a back button on
the user's browser, as well as a handy dandy backspace key that does
the same trick, not to mention the mouse gesture, should the client be
so enabled.

Or the ALT-LeftArrow.
 
C

chumley

Gazing into my crystal ball I observed chumley <[email protected]>
writing in (e-mail address removed):







ASP has no idea about what's happening on the client, so would never get
that information.

By the way, you're reinventing the wheel.  There is a back button on the
user's browser, as well as a handy dandy backspace key that does the same
trick, not to mention the mouse gesture, should the client be so enabled.

There is another suggestion in this thread about using session variables. 
That can work, but I prefer to explicitly state the name of the file for
the action attribute, or better yet, have the form submit to itself.

YMMV

No, has to be customizeable button that carries querystrings upon
conditions. I have a lot of these figured out now, thanks for looking/
replying :), may hav more questions regarding this
chumley
 
B

Bob Barrows

chumley said:
No, has to be customizeable button that carries querystrings upon
conditions. I have a lot of these figured out now, thanks for looking/
replying :), may hav more questions regarding this
chumley

Well, you'll get more people looking at them if you post them to relevant
newsgroups. Client-side questions should be asked at .scripting.jscript or
comp.lang.javascript.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed chumley <[email protected]>
writing in

Please don't quote signatures.
No, has to be customizeable button that carries querystrings upon
conditions. I have a lot of these figured out now, thanks for looking/
replying :), may hav more questions regarding this
chumley

And what are you going to do if the user has client side scripting
disabled or unavailable? Just make sure that you're covered server side.
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top