This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello Ranchers, how can one set up a default value in a drop-down menu. For instance, if the drop down has "one", "two", "three" and "four" in the drop list. How can one programmatically set "three" as the default when the page is loaded.
I don't mean how to obtain the selected value on the selectOneMenu, but to set pre-selected value on the drop-down when the page is loaded. To achive this in HTML, here is an example on how to set three as pre-selected value. <pre> <select name="numbers"> <option value="one">one</option> <option value="two">two</option> <option value="three" selected="selected">three</option> <option value="four">four</option> </select> </pre>