Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Set a disabled option as default, maybe?
Don't forget to set it selected.
I can't remember exactly but I think it's something like that -
@DivineInfinity
Does your <select> have name or id? One of them is mandatory if I recall it correctly
How do you take it? -
@DivineInfinity
Check if you spell it correctly. Can you test it from a browser to see with F12 if it has what you need?
If all your answers are yes, then I don't know. Maybe it has to do with how you call your Java thing. -
LeMeow61929y@lostinmyworld Everything is spelled correctly. It works only when I select an option. -
surgiie15189yShould work if you give a name to the select tag and use selected attribute on the option you want as your default.
Related Rants

What only relying on JavaScript for HTML form input validation looks like
Yeah no
!rant
How do I set a default value for a dropdown if no option is selected?
I tried
<option value="">Select one option</option>
or value="0"
It gives me a NullPointerException
undefined
question
html
java