skip to Main Content

jQuery ajax parameters not being passed to php as expected

I have the following javaScript code: const getReport = { jobID: $('#jobID').val(), startDate: $('#summaryStart').val(), endDate: $('#summaryEnd').val(), tableType: 'Summary', }; $.ajax({ url: "php/reports.php", contentType: "application/json", type: "post", dataType: "application/json", data: function (d) { return JSON.stringify(getReport); }, success: function (response) { if…

VIEW QUESTION

Sending data to controller with ajax in ASP.NET Core – Jquery ajax

I can't send the data to the controller with ajax. goes "null". please help me. my html codes: <div class="modal fade" id="sagTikMenuKategoriGuncelleModal" data-bs-backdrop="static"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header" style="font-weight: 600; color: rgb(157, 163, 173); background-color: rgb(248, 248, 248);">…

VIEW QUESTION

How to handle multiple form data via ajax to php – Jquery ajax

<input type="text" value="2021-05-01" class="date" name="date"> <input type="text" value="10:00" class="starttime" name="starttime"> <input type="text" value="17:00" class="endtime" name="endtime"> <input type="text" value="7" class="hours" name="hours"> Normally I handle this data as shown below: var date $('.date');val(); var starttime $('.starttime');val(); var endtime $('.endtime');val(); var hours $('.hours');val();…

VIEW QUESTION
Back To Top
Search