By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,892 Members | 775 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,892 IT Pros & Developers. It's quick & easy.

Javascript - Java list menu

P: 1

I am retrieving a selected item from a list/menu component on an
HTML page. The said value is passed as a parameter to a method
initiated through <jsp:useBean.

I am aware that when the user selects an item from the list/menu an
onChange event is triggered. I have handled this event by a javascript

The table is populated according to the selected item, and therefore I have used the following syntax in order to populate an already defined table 'tblResults': var x=document.getElementById('tblResults').insertRow( );

Before populating each row I need to retrieve the data using the method <% outResult = result.getResult(xxx);%>, where results is the object declared by the <jsp:useBean. The xxx refers to a variable pointing to the HTML list/menu. I am able to call this method through the use of scriptlets. When I pass a value instead of xxx the process works correctly and the data is loaded into the database, however I cannot find a way of how I can pass the variable. I attempted to use

I would appreciate your kind help

Happy Christmas and thanks
Dec 24 '09 #1
Share this Question
Share on Google+
2 Replies

P: 607
Have a input type hidden in ur html and set the value when the select is changed. You can access that input value using request.getAttribute("hidden field name ")

Thanks and Regards
Ramanan Kalirajan
Dec 28 '09 #2

Expert Mod 15k+
P: 16,027
You're mixing up Java/JSP and JavaScript. One is server-side and one is client-side. If you want to use both without a page reload, use Ajax.
Dec 30 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.