Javascript open link in same window

G

gil

I have a form that I would like to get the values entered on the page
and go to a new page in the same window. I can make the code work to
open a new window, but I need it to open in the same window. Any help
would be greatly appreciated.

Here is what I have:


function pass_info() {

var info = "";

info += document.form2.productWeight.value;
window.open("/page/shippingrates/calculate_shipping_before.asp"
+ "?" + "weight=" + info,");
}

I know that it is the window.open, but I have not figured out what I
need to do to get it in the same window.

Thanks
 
G

gil

I do not want it overwritten, but location.href does not work.
location.replace works, but not what I need. Do you have any other
ideas on what I can use.

Thanks,
 
K

kaeli

I do not want it overwritten, but location.href does not work.

Clarify "does not work".
What happens or doesn't happen?

And if this is a frameset, say so.

What happens (or doesn't happen) when you do the following:

info += document.form2.productWeight.value;
window.location.href = "/page/shippingrates/calculate_shipping_before.asp?
weight=" + info;

Note that word-wrap may split that into three lines when it should be two.

If you get an error, post it.

--
 
T

Thomas 'PointedEars' Lahn

I do not want it overwritten, but location.href does not work.

It works. Only your source code or the JavaScript Console
can tell why it does not work for *you* *there*.
location.replace works, but not what I need.

It fulfills the requirement of "open in the same window", though.
Do you have any other ideas on what I can use.

Do you have more code or error messages?


PointedEars
 

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
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top