Skip to content

Instantly share code, notes, and snippets.

@aaryan79831014
Created March 14, 2018 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaryan79831014/0969458840ec81770b571f73850b7245 to your computer and use it in GitHub Desktop.
Save aaryan79831014/0969458840ec81770b571f73850b7245 to your computer and use it in GitHub Desktop.
Clear all inputs jquery modal form when the form closes
$(document).ready(function () {
// clear all the inputs on the form on the modal id documentModal
$('#documentModal').on('hidden.bs.modal', function (e) {
$('input[type=radio]').prop('checked', false);
$('input[type=checkbox]').prop('checked', false);
$(this)
.find("input,textarea,select")
.val('')
.end()
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment