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();
    }
  });
}) 
Rate this blog entry:
Bootstrap Toggle Adding Dynamic Elements
Git Rename Branch Local and Remote Securely

Comments

 
No comments yet

Latest Comments

Susan Hermiston Virtual Hosts
October 7, 2015
Wow 747 just blew me away. Sorry not a tech person at all!! But I still love you!! Rock on!!?
Johmny Invisible Mouse Cursor Ubuntu & Synergy
September 2, 2015
Glad I was ble to help!
Kristian Falk Invisible Mouse Cursor Ubuntu & Synergy
September 1, 2015
Thank you for this! Had the exact same problem. I almost went crazy.