I'm using autoform with simple-schema and trying to pre-select a value from a dropdown list. I either crash the app or get no notice, no result, nothing. The selected value still shows (Select One). Here's the block from my schema:
status:{
type: String,
label: "Status",
allowedValues: ['Approved','Pending','Flagged'],
autoValue: function() {
return {label: 'Pending', value: 'Pending'};
}
},
Add the value
attribute.
{{afQuickField name="fieldName" options="allowed" value="option1"}}
Found here: https://github.com/aldeed/meteor-autoform/issues/52
Taken from the documentation: https://github.com/aldeed/meteor-autoform#affieldinput
To specify a label to be displayed when there is no option selected, set firstOption="(My Select One Label)".
firstOption: Use with the options attribute to specify a string to use for the first option of a select input, which shows when nothing has been selected yet. For example, firstOption="(You Should Really Pick Something From This List)". There is a default first option "(Select One)". If you don't want any default option, then do firstOption=false, but make sure your select input has a default value or this will result in a confusing UX where it looks like the first option is selected but it isn't.
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