Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Hyperlinks 1

Status
Not open for further replies.

verman8

Programmer
Jul 20, 2004
5
US
I am working on a JSP page, but I was requested to change the dynamicly created table with a set of dynamiclly created hyperlinks.

heres an example of whats generated:

<SELECT NAME=show SIZE=15>
<OPTION VALUE=wpf>wpf, What Planet Are You From, Dave Taritero, Patrick Mc Clung, , 1093, 0
<OPTION VALUE=xx2>xx2, XXX2, , , , 3, -1
<OPTION VALUE=xyz>xyz, Xavier and You at the Zoo, Sally Mae, Tim Johnson, , 0, 0
<OPTION VALUE=ygm>ygm, You Got Mail, Julia Rivas, , , 90, 0
<OPTION VALUE=yrd>yrd, The Longest Yard, Debbie Denise / Daniel Kuehn, Sheena Duggal, , 1, -1
</SELECT>

...

<input type=submit name=show_search value="Select Show"> &nbsp;&nbsp;

In the JSP script, I have all the info (the info separated by commas) drawn individually. So thats not a problem. Basically in this script I really need is to know how to change links that all act as their own submit buttons.
 
if i understand you correctly, you wish to be forwarded to some page depending on what is selected from the drop down menu. is that right? in that case, you may try something like:

-----------------------------------------------------
<%@ page import="javax.servlet.RequestDispatcher"%>

<%
String link = request.getParameter("linkOptions");

RequestDispatcher disp = request.getRequestDispatcher("/"+link);
disp.forward(request, response);
%>

<form action="<%=link%>" method="post">

<SELECT NAME="linkOptions">
<OPTION VALUE="linkA.html">choice a
<OPTION VALUE="linkB.html">choice b
<OPTION VALUE="linkC.html">choice c
<input type="submit" value="Submit" />

</form>
-----------------------------------------------------

let me know if i misunderstood your question.

regards.
 
That's not exactly what I was looking for, Thank you for the response though. That script works, but I was asked to change it from the table to a bunch of hyperlinks. I've been thinking about it, and I think I know what to do now. But if it gives me trouble I'll be sure to post to see if anyone can help me. Thank you again for your effort, it is greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top