Started work on AJAX with a different approach, this is WIP but edit contact currently uses it. with this approach your dont have to touch the js or modal template just the ajax
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
$(document).on('click', '.edit-contact-btn', function(e) {
|
||||
e.preventDefault();
|
||||
var contactId = $(this).data('contact-id');
|
||||
$('#editContactContent').html('Loading...'); // optional loading text
|
||||
$.get('ajax_edit_contact.php', { contact_id: contactId }, function(response) {
|
||||
$('#editContactContent').html(response);
|
||||
$('#editContactModal').modal('show');
|
||||
}).fail(function() {
|
||||
alert('Error loading contact details.');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user