1

I have an HTML select form with several options in it. I want a default option of "(select an issue)", but I don't want that option to be submittable. I want the "Please fill out this field" message to show up if the user tries to submit with this option selected.

I've seen this many times on other sites, so I know it's possible, some way or another, but I'm not sure how to approach it.

Knight Steele
  • 169
  • 4
  • 14
  • Could you please copy and paste your code onto your question? – LemmyX Mar 24 '20 at 16:59
  • Try this: [https://stackoverflow.com/questions/5805059/how-do-i-make-a-placeholder-for-a-select-box](https://stackoverflow.com/questions/5805059/how-do-i-make-a-placeholder-for-a-select-box) – Jasper Kent Mar 24 '20 at 17:05

1 Answers1

0

This link: How do I make a placeholder for a 'select' box?, provided by Jasper Kent, helped me figure it out.

There was a solution to do the following:

<select>
    <option value="" disabled selected>Select your option</option>
    <option value="hurr">Durr</option>
</select>

This forces the option to have to be switched before submission, and the user cannot re-select that option either. It also makes it the default selection.

Knight Steele
  • 169
  • 4
  • 14