How to clear all input fields and error messages in bootstrap modal when clicking data-dismiss button?

 $(document).ready(function(){
    $('.modal').on('hidden.bs.modal', function (e) {
      $(this)
      .find(" input[type=text], textarea,select").val('').end()
        .find("input[type=checkbox], input[type=radio]").prop("checked", "").end()
        /*remove error field when modal close     */
        .find(".has-error").removeClass("has-error").end()
    .find(".has-success").removeClass("has-success").end()
    .find(".FeRror").empty().end();    

    })
    })

Comments

Popular posts from this blog

datatable with both top and bottom scroll bar.

Display Loader and disable page while waiting for ajax request

Invalid bean property or is not readable to loading Jsp page