html - Execute JavaScript when Select Element Has Only 1 Option -


i have select element in html form. options of element populated dynamically. when there more 1 option have javascript execute when user selects option like.

however, when select element has 1 option have javascript submit automatically. tried setting option selected , adding onselect. don't think onload work either.

this html when there 1 option:

<select name="acctnumber_box" id="acctnumber_box" onselect="filldistributoracctnumber (value)">                                    <option selected="selected"><%=customernumber %> &nbsp; <%= customername %></option> </select> 

does have solution this?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -