How to use
option tag? Below is my code in which I tried to implement that, but it is not working as expected.
listCustomer domain object list getting in JSP page.
How do I modify it to detect that an option is selected?
onClick() events are supported by the
<option> tag. The former refers to selecting text (i.e. by clicking + dragging across a text field) so can only be used with the
<textarea> tags. The
onClick() event can be used with
<select> tags – however, you probably are looking for functionality where it would be best to use the
onChange() event, not
Furthermore, by the look of your
<c:...> tags, you are also trying to use JSP syntax in a plain HTML document. That’s just… incorrect.
In response to your comment to this answer – I can barely understand it. However, it sounds like what you want to do is get the value of the
<option> tag that the user has just selected whenever they select one. In that case, you want to have something like: