?
Solved

No values

Posted on 2003-03-27
7
Medium Priority
?
194 Views
Last Modified: 2012-05-04
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!
0
Comment
Question by:Amy01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 8221174
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
 

Author Comment

by:Amy01
ID: 8221626
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
 
LVL 14

Expert Comment

by:kennethxu
ID: 8221861
try this:

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

<A href="myTest/controller/SearchFiles?server=<%=search%>&appTLA=<%=appTLA%>"
....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Amy01
ID: 8221974
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
 
LVL 14

Accepted Solution

by:
kennethxu earned 200 total points
ID: 8222046
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
 
LVL 2

Expert Comment

by:amit_chauhan
ID: 8222109
What is the error you're getting ?

Amit
0
 
LVL 2

Expert Comment

by:amit_chauhan
ID: 8222115
Just noticed...u are using javascript wrongly in href.

kenneth's method to call javascript function should work

Amit
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question