Send a browser to a link with Javascript

M

mcraven.2

How do you send a browser to a link when a command is given? I've
tried using Java Server Pages <jsp:forward /> command but that doesn't
change the link in the address bar and some other problems arise with
it. A javascript method would work in what I'm doing but I don't know
what that command would be. Basically, when a button is pressed I want
some session data to be set and for a link to be followed.

Any ideas?
 
M

mcraven.2

Well I found one way just now but I don't think it will work. What I
tried was the following successful command in a javascript function:

document.location.href="index.html";

I think what I'm really wanting is for a form to be submitted to a
particular page. Let me explain further. I have 3 basic forms that
represent 3 object types. Object 2 has an object 1 and object 3 has an
object 2. So if I'm on a form for object 2 and I want to create a new
object 3 I would want to go to the object 3 form with the correct
object 2 value selected based on the previous form. I guess I could do
this with sesssion data but I'm unclear on that as well. How do I set
session data?

I also want the forms cancel button to revert the user back to the
previous form they were on. Here I'm thinking I will keep a list of
forms that have been visited and push and pop pages off that list as
the user navigates the forms. I can imagine doing this with session
data or with hidden input variables that I set at the bottom of the
form.
 
D

DartmanX

What do you mean "command"?

I manage a wizard setup by creating a form with an empty action, and a
js function to set the action. The "previous" button sets the form
action to the previous page, the "next" button sets the form action to
the next action, "finish" to the last page, etc.

Jason
 

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,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top