input field question

T

thomanjl

This is my input field code:

<input name="subButton" type="button" value="Cancel"
onclick="javascript: Response.Redirect URL_HOME />

My problem is the button doesn't redirect to the destined url...any
ideas??

thanks

jeremiah thoman
 
J

Jonathan N. Little

thomanjl said:
This is my input field code:

<input name="subButton" type="button" value="Cancel"
onclick="javascript: Response.Redirect URL_HOME />

My problem is the button doesn't redirect to the destined url...any
ideas??

Firstly, what would happen if client has JavaScript disabled, eh?.
Secondly that is not how you do a JavaScript redirect. Thirdly you
should not do this with JavaScript but with server-side scripting.

Not familiar with ASP but in pseudo code, your cancle button should be a
submit button


<form action="receiving.script" method="post">
....
<input type="submit" name="cancel" value="Cancel">

then "receiving.script"

if in POST var cancel exists then
{
redirect header to URL_HOME
}
else
{
process form posted data
}
 
S

spiffy

I could be wrong, but I don't think you are supposed to include the
"javascript:" part

I think it should be:

<input name="subButton" type="button" value="Cancel"
onClick="Response.redirect URL_HOME" />

OR

<input name="subButton" type="button" value="Cancel"
onClick="Response.redirect URL_HOME" />

maybe?
 
S

spiffy

you can also call a redirect using:

location.href='index.htm'

so
<input name="subButton" type="button" value="Cancel"
onclick="location.href='URL_HOME'" /> should work too

but remember, URL_HOME has to be defined
 
S

spiffy

you can also call a redirect using:

location.href='index.htm'

so
<input name="subButton" type="button" value="Cancel"
onclick="location.href='URL_HOME'" /> should work too

but remember, URL_HOME has to be defined

(sorry for the multiple posts)
 
Joined
Feb 20, 2010
Messages
2
Reaction score
0
to know about how to create buttons in html

dear sir,

i am chennakesava reddy.,

my problem is that when we click a button some of the subbuttons must be display from that button.

would you tell me any answer for my problem.

:help: :help:
 
Joined
Feb 20, 2010
Messages
2
Reaction score
0
to create subbuttons from a button.

dear sir,

i am chennakesava reddy.,

my problem is that when i click a button some of the subbuttons must be display from that button.

would you tell me any answer for my problem.

:help: :help:
 

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,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top