mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Updates to AJAX forms and adding autofill function to the event form when adding things via AJAX
This commit is contained in:
@@ -138,9 +138,17 @@
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(document).on('click', '.modal-href', function (e) {
|
||||
e.preventDefault()
|
||||
modaltarget = jQuery(this).data('target')
|
||||
modalobject = "";
|
||||
jQuery('#modal').load(jQuery(this).attr('href'), function (e) {
|
||||
jQuery('#modal').modal();
|
||||
});
|
||||
jQuery('#modal').on('hide.bs.modal', function(e) {
|
||||
if(modaltarget != "" && modalobject != "") {
|
||||
jQuery(modaltarget).val(modalobject[0]['pk']);
|
||||
jQuery(modaltarget+'-input').val(modalobject[0]['fields']['name']);
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user