No values

My Browser page has two list boxes. It will call command SearchFiles with the values of server and TLA the user selected from the list boxes when the user clicks the link on the navbar.

The following code can't get server and appTLA value. Do you know what the problem is?

<A href="myTest/controller/SearchFiles?server="+document.forms[0].search.value + ";appTLA=" +document.forms[0].appTLA.value +" onfiltered="MM_swapImgRestore()" onfiltered="MM_swapImage('navsearch','','<%=ctxPath%>/images/nav_search_ov.gif',1)"><IMG name="navsearch" border="0" src="<%=ctxPath%>/images/nav_search_up.gif" width="142" height="18"></A>

Thanks for the help in advance!
Amy01Asked:
Who is Participating?
 
kennethxuConnect With a Mentor Commented:
then try this:

<script>
function gosearch() {
   location= "myTest/controller/SearchFiles?server=" + document.forms[0].search.options[document.form[0].server.selectedIndex].value + "&appTLA=" +document.forms[0].appTLA.options[document.form[0].appTLA.selectedIndex].value
}
</script>

<A href="javascript:gosearch()"
...
0
 
kennethxuCommented:
It won't work! you cannot use javascript like this!

>> It will call command SearchFiles with the values of server and TLA the user selected from the list boxes when the user clicks the link on the navbar.
don't understand, please explain it more clearly.

thanks.
0
 
Amy01Author Commented:
My Browse Page has two listboxes. One is server list, another is TLA listbox. The link image "Search" will display Search page which has the same values of server and TLA which the user selected from the previous page Browse.
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
kennethxuCommented:
try this:

<%
String search = request.getParameter( "search" );
String appTLA = request.getParameter( "appTLA" );
%>

<A href="myTest/controller/SearchFiles?server=<%=search%>&appTLA=<%=appTLA%>"
....
0
 
Amy01Author Commented:
Both search and TLA are on the Browse page. How can pass the values which the users selected on Browse page to another page Search using server side java code? I may need to try the following code:

<A href="myTest/controller/SearchFiles?server="+document.forms[0].search.options[document.form[0].server.selectedIndex].value + "&appTLA=" +document.forms[0].appTLA.options[document.form[0].appTLA.selectedIndex].value +" onfiltered="MM_swapImgRestore()" onfiltered="MM_swapImage('navsearch','','<%=ctxPath%>/images/nav_search_ov.gif',1)"><IMG name="navsearch" border="0" src="<%=ctxPath%>/images/nav_search_up.gif" width="142" height="18"></A>
0
 
amit_chauhanCommented:
What is the error you're getting ?

Amit
0
 
amit_chauhanCommented:
Just noticed...u are using javascript wrongly in href.

kenneth's method to call javascript function should work

Amit
0
All Courses

From novice to tech pro — start learning today.