I need select box for column to update

I need select box for column to update

vidhyaprakash85vidhyaprakash85 Posts: 2Questions: 1Answers: 0

i have datatables inserted in my code. if the user want to change data then i need to provide select box containing data and after selecting need to update in the database please help me.

Answers

  • vidhyaprakash85vidhyaprakash85 Posts: 2Questions: 1Answers: 0

    $('#bloodgroup_search').on('change', function() {
    var bloodgroup = $("#bloodgroup_search").val();
    var url = "blood-donor-search-fetch.php?bloodgroup=" + bloodgroup + "";
    var myTable = '';
    $("#donor_list").html('<center><img src="images/donate_blood.gif" alt="Data Loading"></center>');
    $.getJSON(url, function(json) {
    if (json == null)
    {
    myTable += "<center>

    No Donors found with this Blood Group!!!!

    </center><br/>";
    $("#donor_list").html(myTable);
    }
    else
    {
    myTable += "

    "; myTable += ""; $.each(json, function(k, v) { myTable += ""; }); myTable += "
    S.NODonor NameGenderCityMobile NumberUpdate Donor Status
    " + v.sno + "" + v.donorname + "" + v.gender + "" + v.city + "" + v.mobilenumber + "Already DonatedDiseaseNot Interested

    ";
    $("#donor_list").html(myTable);

            $('#dataTable').dataTable({
                "columns": [
                    null,
                    {"orderDataType": "dom-select"}
                ]
            });
        }
    });
    

    });

    this is the json fetching data from database in this example i need to place select box (already placed) when users select some value it has update in the database .

    please provide me example links

This discussion has been closed.