New to Kendo UI for jQuery? Start a free 30-day trial

Required Switch

Updated on Nov 2, 2026

The Switch is created from an input element of type checkbox. To require the user to turn the Switch on before a form is submitted, use the Kendo UI Validator with the required attribute of the input element.

To make the Switch mandatory:

  1. Add the required attribute and a name attribute to the input element.
  2. Optionally, set the message that the Validator displays through the validationMessage attribute.
  3. Initialize the Switch.
  4. Initialize the Validator on the form element.

When the Switch is off, the Validator displays the validation message and prevents the form from being submitted. When the Switch is on, the form is submitted.

The following example demonstrates how to require the Switch to be turned on.

html
<form id="form">
    <input type="checkbox" id="accept" name="Accept" required validationMessage="Acceptance is required" />
    <label for="accept">Accept the terms</label>
    <button type="submit" class="k-button">Submit</button>
</form>
<p id="result"></p>

<script>
    $("#accept").kendoSwitch();
    $("#form").kendoValidator();

    $("#form").on("submit", function(e) {
        e.preventDefault();
        $("#result").text("The form is valid.");
    });
</script>

See Also

In this article
See Also
Not finding the help you need?
Contact Support