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