I am having a custom table that has several items and has a column of status. I have created a dropdown using select for changing the status.
Here, what I want to do is, on change of the status select option, the value of status of that particular row should be updated in the db. I am able to get the value of the select using jquery but I am not sure how to update the table when multiple dropdowns are being selected together.
I am having the below select options,
<select id ="update-statusDropDown">
<option name="waiting" value="waiting">Waiting</option>
<option name="due" value="due">Due Diligence</option>
<option name="escrow" value="escrow">Escrow</option>
<option name="inspection" value="inspection">Inspection</option>
<option name="closed" value="closed">Closed</option>
</select>
My jQuery is something like below,
jQuery(document).ready(function () {
jQuery('select#update-statusDropDown').change(function () {
//Selected value
var inputValue = $(this).val();
alert("value in js " + inputValue);
//Ajax for calling php function
jQuery.post('update-listing-status.php', {dropdownValue: inputValue}, function (data) {
alert('ajax completed. Response: ' + data);
//do after submission operation in DOM
});
});
});
I want to update status value in the table as per the 'inputValue' from the dropdown. Also, if multiple dropdowns are selected together, how can I update all the values together. Please can anyone help?