Droplist calling scriptlet/beans

Discussion in 'Java' started by unlikeablePorpoise@gmail.com, Mar 19, 2007.

  1. Guest

    I would like to have an HTML dropdown list where each selection calls
    a method. The following code doesn't work, but it I hope it gives the
    idea of what I'm trying to do:

    <FORM NAME="frm">
    <SELECT NAME="sel"
    onChange="document.frm.sel.options[document.frm.sel.selectedIndex].value">
    <OPTION SELECTED value="">--choose--
    <OPTION VALUE="<% package1.method1; %>">Call Method 1
    <OPTION VALUE="<% package1.method2; %>">Call Method 2
    <OPTION VALUE="<% package1.method3; %>">Call Method 3
    </SELECT>
    </FORM>

    Basically I would like to use the JavaScript 'onChange' to invoke the
    method I select from the list.

    Any help would be appreciated. And if this is off-topic, let me
    know :) ...

    Thanks,
    Sarah
     
    , Mar 19, 2007
    #1
    1. Advertising

  2. Wojtek Guest

    wrote :
    > I would like to have an HTML dropdown list where each selection calls
    > a method. The following code doesn't work, but it I hope it gives the
    > idea of what I'm trying to do:
    >
    > onChange="document.frm.sel.options[document.frm.sel.selectedIndex].value">


    > Basically I would like to use the JavaScript 'onChange' to invoke the
    > method I select from the list.


    You need to post tis in the JavaScript groups. This is the Java group.
    Any Java objects would not be at all visible at the browser level.

    --
    Wojtek :)
     
    Wojtek, Mar 20, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Powell
    Replies:
    0
    Views:
    1,664
    Phil Powell
    Nov 21, 2003
  2. Robert Mark Bram

    Share vars between scriptlet and jstl?

    Robert Mark Bram, Mar 20, 2005, in forum: Java
    Replies:
    1
    Views:
    15,392
    Ryan Stewart
    Mar 20, 2005
  3. Torsten Schmeissel
    Replies:
    0
    Views:
    433
    Torsten Schmeissel
    Apr 29, 2005
  4. Hats
    Replies:
    3
    Views:
    474
    Spartanicus
    Jun 20, 2005
  5. Replies:
    7
    Views:
    137
    Richard Cornford
    Mar 22, 2007
Loading...

Share This Page