skip to Main Content

Twitter bootstrap – removeClass("has-error") when field was changed Bootstrap, javascript

My Javascript $('.input-group').each(function() { $mainElement = $(this); $sibling = $mainElement.next('.form-control'); $sibling.change(function($mainElement) { return function() { $mainElement.removeClass('has-error'); } }($mainElement)); }); My Form <div class="form-group"> <label>Organization</label> <div class="input-group has-error"> <input type="text" class="form-control" name="organization" /> <!--added code--> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span> </div> </div>…

VIEW QUESTION
Back To Top
Search