| Author |
Need help with forwarding on JSP based on value selection
|
owen dodd
Greenhorn
Joined: Apr 01, 2004
Posts: 7
|
|
Hello i wish to forward to different url based on the values have entered on my jsp form. To be more specific i have a drop down with a list such as Health and Legal. What i want to do i that when i submit to the database ( i enter my details successfully to the database[which i can do successfully] but i want to when i submit to foward onto a health.jsp or a legal.jsp based what i have chosen from the drop down. I wish to code this in jsp!PLEASE HELP!!!1 [ April 01, 2004: Message edited by: Bear Bibeault ]
|
 |
li jian
Greenhorn
Joined: Apr 01, 2004
Posts: 1
|
|
You want to submit the jsp to different url's based on the the value selected in the drop down box. I hope i got that right. I will advice u to do that coding in a client side scripting language like Java Scipt or Vb script. u could call a java script function when the submit button is clicked and choose the url based on the value and then forward the page to that url.U could find the code in any java script book. I hope i have solved ya problem, please let me know if ya have any doubts.
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50677
|
|
|
Moving this to the HTML/Javascript forum as this is a client-side activity. I'll meet you there!
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50677
|
|
|
In a Javascript change handler for your dropdown, all you need to do is to swap out the action property of the form to the appropriate URL.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
look at this script here: http://www.javascriptkit.com/script/cut147.shtml Eric
|
 |
owen dodd
Greenhorn
Joined: Apr 01, 2004
Posts: 7
|
|
Thank for this piece of code inside my form of which i am using to insert a student to my database. I was wonderin how do i go about changing my struts-configfile.xml? Thank for the help
|
 |
 |
|
|
subject: Need help with forwarding on JSP based on value selection
|
|
|