473,289 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Send a browser to a link with Javascript

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?

Jul 22 '06 #1
2 1927
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.

mcrave...@wright.edu wrote:
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?
Jul 22 '06 #2
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

mc*******@wright.edu wrote:
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.

mcrave...@wright.edu wrote:
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?
Jul 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: edykstra | last post by:
Hello, If you point your browser to this page, http://prdownloads.sourceforge.net/vnc-tight/tightvnc-1.2.9_x86_viewer.zip?use_mirror=umn the server sends you the HTML page, and very soon...
6
by: bayram guzer | last post by:
hi everybody, i have very strange error. i can not see some of the asp pages on my browser. when i look from view source, all the source is there but browser does not show anything, just an empty...
3
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm...
13
by: AMC | last post by:
Hi, I have the below code in an asp page. When I run this page in IE or Opera it correctly displays the header info and does not redirect me to 'test.html'. However, when I run this in Netscape...
5
by: Prabhat Nath | last post by:
Hi All, Is that possible that I can send request to IIS Server after a .ASP page is displayed? My Requirement is: Clinet will Fill the Details in one Request Form after the details are...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
4
by: Thomas Eichner | last post by:
Hi, does anybody know a public website which offers a service that displays all data send by a browser (or an app calling the website), especially HTTP GET and POST data, browser data etc.? I...
1
by: Anil G | last post by:
Hi! If page has the link, let say page has following hyperlink <a href="javascript:editUser('<c:out value="${users.id}"/>')"><c:out value="${users.username}"/></a> Now, on web browser, bottom...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.