Results 1 to 3 of 3
Thread: how to get selected value
- 04-08-2011, 12:17 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 51
- Rep Power
- 0
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
- 04-08-2011, 05:40 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Without submitting the form? Read about how to use AJAX.
- 05-03-2011, 07:08 AM #3
Member
- Join Date
- May 2011
- Posts
- 1
- Rep Power
- 0
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.......
Similar Threads
-
how to get the currently selected row fo a jtable?
By kulangotski in forum AWT / SwingReplies: 4Last Post: 01-16-2011, 05:22 AM -
How to get the selected item from combox
By man4ish in forum AWT / SwingReplies: 5Last Post: 12-30-2009, 10:29 AM -
JButton selected
By sky in forum AWT / SwingReplies: 6Last Post: 12-05-2009, 09:36 PM -
SELECTED select menu??
By Samurai Coder in forum New To JavaReplies: 1Last Post: 12-03-2009, 06:09 PM -
JTable problem with getting ROW selected
By nadia in forum Advanced JavaReplies: 2Last Post: 01-13-2009, 05:57 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks