Results 1 to 3 of 3
  1. #1
    gedas is offline Member
    Join Date
    Feb 2010
    Posts
    51
    Rep Power
    0

    Default how to get selected value

    hey,


    i have jsp file that contains drop-down list once the value is selected from drop down list one of the javascript methods gets invoked that alerts me with what has been selected.

    what i need is once the value has been selected it would be sent to a my java class to one of the methods and the value returned by the method should be alerted back to the user
    could this be done?


    any suggestions will be greatly appreciated
    thank you

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Without submitting the form? Read about how to use AJAX.

  3. #3
    hiimmanas is offline Member
    Join Date
    May 2011
    Posts
    1
    Rep Power
    0

    Thumbs up Drop down value

    Set some option value for each and every option,
    after that when u call it from js, check the value of the field(dropdown option) is matched with what value....
    e.g.

    <select namer="xyz" value="">
    <option selected value="">select</option>
    <option value="a">HI</option>
    <option value="b">Hello</option>
    </select>

    js:-

    if(document.formname.xyz.value="a")
    {
    alert("Selected option is HI");
    }

    thats all.......

    Quote Originally Posted by gedas View Post
    hey,


    i have jsp file that contains drop-down list once the value is selected from drop down list one of the javascript methods gets invoked that alerts me with what has been selected.

    what i need is once the value has been selected it would be sent to a my java class to one of the methods and the value returned by the method should be alerted back to the user
    could this be done?


    any suggestions will be greatly appreciated
    thank you

Similar Threads

  1. how to get the currently selected row fo a jtable?
    By kulangotski in forum AWT / Swing
    Replies: 4
    Last Post: 01-16-2011, 05:22 AM
  2. How to get the selected item from combox
    By man4ish in forum AWT / Swing
    Replies: 5
    Last Post: 12-30-2009, 10:29 AM
  3. JButton selected
    By sky in forum AWT / Swing
    Replies: 6
    Last Post: 12-05-2009, 09:36 PM
  4. SELECTED select menu??
    By Samurai Coder in forum New To Java
    Replies: 1
    Last Post: 12-03-2009, 06:09 PM
  5. JTable problem with getting ROW selected
    By nadia in forum Advanced Java
    Replies: 2
    Last Post: 01-13-2009, 05:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •