Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > input field question

Reply
Thread Tools

input field question

 
 
thomanjl
Guest
Posts: n/a
 
      08-04-2006
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

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      08-04-2006
thomanjl wrote:
> 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
}



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
spiffy
Guest
Posts: n/a
 
      08-04-2006
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?


thomanjl wrote:
> 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


 
Reply With Quote
 
spiffy
Guest
Posts: n/a
 
      08-04-2006
Jonathan is right...

that's how I would do it, in the ASP or Ruby code


thomanjl wrote:
> 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


 
Reply With Quote
 
spiffy
Guest
Posts: n/a
 
      08-04-2006
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


thomanjl wrote:
> 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


 
Reply With Quote
 
spiffy
Guest
Posts: n/a
 
      08-04-2006
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)

thomanjl wrote:
> 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


 
Reply With Quote
 
chennakesava reddy chennakesava reddy is offline
Junior Member
Join Date: Feb 2010
Posts: 2
 
      02-21-2010
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.

 
Reply With Quote
 
chennakesava reddy chennakesava reddy is offline
Junior Member
Join Date: Feb 2010
Posts: 2
 
      02-21-2010
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
event question for a time input field JRough Javascript 2 02-03-2012 09:46 PM
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
how to show an Image field from a SQL Server table field to a aspx page J Sahoo ASP .Net 3 04-30-2009 08:30 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
form input field, scroll bar and focus question... Indu Javascript 0 12-21-2005 02:43 PM



Advertisments