This happens because the state of the underlying input element of the Switch is changed in code when you click the Switch widget. Input elements do not fire their change
event when their value is changed in code and the Validator is listening for change
events in the inputs that it is tied to. As there is no such event when clicking the Switch, validation is not triggered.
The simplest solution is to handle the Switch change
event and manually trigger validation:
validator = $(
Here is the modified Dojo, where you can see the result: