File manager - Edit - /home/autoph/public_html/projects/Rating-AutoHub/public/js/template/create.js
Back
(function(e){ "use strict"; var questionArr = []; var id = null; var url = null; function submitTemplate(){ $('#template_save').on('click', function(e){ e.preventDefault(); questionArr = []; // $(this).attr('disabled',true); $('input[type="checkbox"]:checked').each(function(){ questionArr.push(this.value); }); //push the question id's into an array var id = $('[name="edit_id"]').val(); var formData = new FormData(); url = "/templates/store"; if(id){ formData.append('id',id); url = "templates/update"; } formData.append('title',$('#template_name').val()); formData.append('questionArr',questionArr); $.ajax({ type: "POST", url: url, dataType: 'json', data: formData, processData: false, contentType: false, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success: function(result){ toastRWithTime("success","success"); window.location.href = '/templates'; }, error: function(error){ toastRWithTime(error.responseJSON.message,"error"); } }); }); } $(function(){ submitTemplate(); $('input[type="checkbox"]').change(function(){ questionArr = []; }); $('#clear_selection').on('click', function(e){ e.preventDefault(); $('input[type="checkbox"]').each(function(){ this.checked = false; }); toastRWithTime("Selection Cleared","info"); }); $('#select_all').on('click', function(e){ e.preventDefault(); $('input[type="checkbox"]').each(function(){ this.checked = true; }); toastRWithTime("Selected all","info"); }); $('#template_back').on('click', function(e){ window.location.href = "/templates"; }); }); })();
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings