473,385 Members | 1,742 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,385 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 1931
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.