I'm working on a Meteor project and I am using the AutoForm package. Now I want to remove the "(Select One)" field from the select dropdown list in my form. How can I do that?
You can use the firstOption
attribute to specify a label, for example:
{{#autoForm id="selectForm" schema=Schemas.Select}}
{{> afFormGroup name="favoriteYear" options=options firstOption="Please select your favorite year"}}
<button type="submit" class="btn btn-primary">Submit</button>
{{/autoForm}}
or you can automatically select the first option (without an empty value) by setting the firstOption
attribute to false
:
{{#autoForm id="selectForm" schema=Schemas.Select}}
{{> afFormGroup name="favoriteYear" options=options firstOption=false}}
<button type="submit" class="btn btn-primary">Submit</button>
{{/autoForm}}