- Can a mandatory field have default value?
- How do I show the default value in a dropdown?
- Would it make sense to specify a default value for a required webform field?
Can a mandatory field have default value?
Required fields must be populated for all instances of actions. For example, the Found by field is required and does not have a default value. When multiple reported by records are created for a single issue, the Found by field must be populated for all records.
How do I show the default value in a dropdown?
The default value of the select element can be set by using the 'selected' attribute on the required option. This is a boolean attribute. The option that is having the 'selected' attribute will be displayed by default on the dropdown list.
Would it make sense to specify a default value for a required webform field?
In general, it doesn't make sense, unless: It is possible to reject the default value, and return an empty value instead. Adding the mandatory mark has security or other benefits.