Skip to content

Instantly share code, notes, and snippets.

@TheYkk
Created November 18, 2018 04:53
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 TheYkk/e23e4b96f387e21e11b8ad63bdf15228 to your computer and use it in GitHub Desktop.
Save TheYkk/e23e4b96f387e21e11b8ad63bdf15228 to your computer and use it in GitHub Desktop.
Modal javascript update
$(function(){
$("#myForm").submit(function(event) {
$.ajax({
type: "POST",
url: 'url.php',
data: $(this).serialize(),
dataType: 'json',
success: function(data)
{
$('#myModal').find('.modal-body').addClass('alert-success');
$('#myModal').find('.modal-body').html(data.message).show;
$('#myModal').find('.modal-body').removeClass('hidden');
$('#myModal').modal('show');
}
});
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment