Skip to content

Instantly share code, notes, and snippets.

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