When an [up-switch]
field changes, this event is emitted on all dependent elements.
You can listen to up:form:switch
to implement custom switching effects.
This event is not emitted on the switching field. Instead each element matching the switch selector will receive an up:form:switch
event:
<!-- Switching field won't receive an event on change -->
<select name="role" up-switch=".role-dependent">
<option value="trainee">Trainee</option>
<option value="manager">Manager</option>
</select>
<!-- Dependent field will receive up:form:switch -->
<input class="role-dependent" name="department">
<!-- Dependent field will receive up:form:switch -->
<input class="role-dependent" name="budget">
The up:form:switch
is emitted at the following times:
[up-switch]
field is transported to a new form.The dependent element matching the [up-switch]
selector.
If multiple elements match the selector, this event is emitted once for each match.
An array describing the state of the controlling [up-switch]
field.
The array contains:
:blank
or :present
, depending on the field's value.:checked
or :unchecked
.