Javascript - Java list menu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tamasu
    New Member
    • Nov 2009
    • 1

    Javascript - Java list menu

    Hi,

    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
    function.


    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.getE lementById('tbl Results').inser tRow();

    Before populating each row I need to retrieve the data using the method <% outResult = result.getResul t(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
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    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.getAttr ibute("hidden field name ")

    Thanks and Regards
    Ramanan Kalirajan

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      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.

      Comment

      Working...