I need a single-selection dropdown that makes sure an option is selected before submitting the form: https://git.uni-due.de/fmi/autotool-dev/-/merge_requests/70#note_250192
This is usually done like this in html:
<select required>
<option value="">---</option>
<option value="1">One</option>
...
The important parts being required attribute and an option with value="" (has to be the first element)
Right now required can be set easily with fsAttrs, but value is "hard-coded" to [1..] in
|
formifyImplementation = renderNextSingleChoiceField (`zip` [1..]) . (=<<) getAnswer |
I'm thinking we can check for the required attribute in renderNextSingleChoiceField and, if it exists, add an additional option with value=""
(Of course there are probably other ways to implement this)
I need a single-selection dropdown that makes sure an option is selected before submitting the form: https://git.uni-due.de/fmi/autotool-dev/-/merge_requests/70#note_250192
This is usually done like this in html:
The important parts being
requiredattribute and an option withvalue=""(has to be the first element)Right now
requiredcan be set easily withfsAttrs, butvalueis "hard-coded" to[1..]inflex-tasks/flex-tasks/src/FlexTask/Generic/FormInternal.hs
Line 488 in 86e93a5
I'm thinking we can check for the
requiredattribute inrenderNextSingleChoiceFieldand, if it exists, add an additional option withvalue=""(Of course there are probably other ways to implement this)