I am trying to give onChange event in combobox in strtuts2
My Code is
But its not going in that function even the first line is also not printing.. i tried all onselect, onclick and onchange but none of them works. Let me know If i can do like this or not or if there is any other way to do it
I tested your code and it functions, but maybe not the way you think it should. If you view the generated HTML code, the onselect event is on the input box. If you select something from the select box and then select the text in the input box the event will fire.
Also, you should be calling alert in your function, not System.out.println.
Joined: Aug 02, 2010
Joined: Dec 16, 2003
dhaval tamboli wrote:I dont know how to see generated html code...
You can see generated html code by selecting the View Page Source option in your browser.
You cannot get the selected value in the combo box, you will have to get the value from the text box. If you assign an id to your combo box, the id is assigned to the text box and you can get the value from the text box.