I've got a basic select box using materializecss.
<select id="type" name="type" required="required" class="validate">
<option value="" disabled="true" selected="selected">Choose your option</option>
<option value="general">General</option>
<option value="tech">Tech</option>
<option value="person">Personnel</option>
<option value="resource">Resourcing</option>
</select>
<label data-error="Select an option">Type of Question</label>
I want the user to select an option before being able to submit the form.
How can I get it to display the data-error
for the label if user doesn't select an option?
$("select[required]").css({display: "block", height: 0, padding: 0, width: 0, position: 'absolute'});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With