Skip to content

Instantly share code, notes, and snippets.

@markjenkins
Created October 22, 2021 18:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Proof of concept that modern browsers will enforce select required, default option disabled on form submit
<!doctype html>
<html lang="en">
<body>
<form method="GET" action="https://duckduckgo.com/">
<select name="q" required>
<option value="" disabled selected>Pick an option</option>
<option value="duck">Duck</option>
<option value="duck">Cat</option>
<option value="duck">Bear</option>
</select>
<input type="submit"></input>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment