Scenario
I want to make sure a user has made a selection on a switch input.
On page load it is either on (1 - in image) or off (2 - in image) depending on what state it is set to in the code.
Problems
- On submit the input is read as either being on or off (never unselected)
- Visually it is not obvious whether the current selection is made by the user or the default state on page load
Solution
To get around the two issues mentioned above, I could change the switch to a couple of radio buttons (3 - in image) That way required validation will fire and also you can visually see no selection has been made by a user.
Alternative Solution?
However, I would like to hear any ideas about solving the two problems mentioned but still retaining the switch control. Is it even possible?
No comments:
Post a Comment