JQuery Validate Single Input on Toggle

In order to validate a single input, use the following function;

$("#inputName").valid(); 

Be sure to add this inside your change.() event, otherwise it won't work.

$(function() {
  $('#toggleButton').change(function() {
    if ($(this).prop('checked') == true) {
      $("#inputName").valid();
    }
  });
}) 
Git Rename Branch Local and Remote Securely
Bootstrap Toggle Adding Dynamic Elements
 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
August 6, 2020

Captcha Image

By accepting you will be accessing a service provided by a third-party external to https://www.johnnyshongo.com/