smallz
07-30-2005, 03:29 AM
Hi there, Javascript gurus!
SIMPLE problem, but this is driving me nuts!!!
I’m using a javascript script that lets you type in values in a text box, and when you click a button it saves it as a cookie.
The code for this button is:
<INPUT onclick=javascript:setFields(); type=button value=" Set " tabindex="4">
The button works fine.
I also need a button that redirects you to another page, much like this button:
<INPUT type=button value=" Redirect " tabindex="4" onClick=window.location='http://www.whatever.com'>
This button works fine.
Here’s the problem:
I need ONE button to perform these TWO things.
When I combine the two…
<INPUT type=button value=" Set and Redirect " tabindex="4" onclick="javascript:setFields(); onClick=window.location='http://www.whatever.com'">
The cookies are set, but I don’t get a redirect.
How do I make the button redirect as well as set the cookies? What do I need to change with the last piece of code?
Or… is there some other way I should be going about this?
Many thanks,
John
PS My deepest apologies – I’m a javascript/coding absolute newbie :-/ Please keep your replies as dumbed-down as poss :-)
SIMPLE problem, but this is driving me nuts!!!
I’m using a javascript script that lets you type in values in a text box, and when you click a button it saves it as a cookie.
The code for this button is:
<INPUT onclick=javascript:setFields(); type=button value=" Set " tabindex="4">
The button works fine.
I also need a button that redirects you to another page, much like this button:
<INPUT type=button value=" Redirect " tabindex="4" onClick=window.location='http://www.whatever.com'>
This button works fine.
Here’s the problem:
I need ONE button to perform these TWO things.
When I combine the two…
<INPUT type=button value=" Set and Redirect " tabindex="4" onclick="javascript:setFields(); onClick=window.location='http://www.whatever.com'">
The cookies are set, but I don’t get a redirect.
How do I make the button redirect as well as set the cookies? What do I need to change with the last piece of code?
Or… is there some other way I should be going about this?
Many thanks,
John
PS My deepest apologies – I’m a javascript/coding absolute newbie :-/ Please keep your replies as dumbed-down as poss :-)