How to change text field label when change select drop box in datatables editor

How to change text field label when change select drop box in datatables editor

TTTTTTTT Posts: 2Questions: 1Answers: 0

I want to change label when changing the value in select drop box.

function loadTestCodeName(){
var testCodeSet = new Array();
$.ajax({
url: "databaseManager.php",
type: "post", //send it through get method
async:false,
data: {'functionID': 'loadTestName'},
success: function (response) {
var json = $.parseJSON(response);

        testCodeSet = new Array();
        for(var i = 0; i < json.length; i++)
        {
            testCodeSet[i] = {"label":json[i].testName, "value":json[i].testCode};
        }
    }
});
return testCodeSet;

}

var testCodeSet = loadTestCodeName();
editor = new $.fn.dataTable.Editor( {
ajax: "datatable/lot_table.php",
table: "#lot-data-table",
idSrc: 'id',
fields: [ {
label: "Test Name:",
name: "test_name",
type:"select",
options:testCodeSet
}, {
label: "Test Value:",
name: "test_value"
}
],
i18n: {
create: {
button: "Create Lot",
title: "Create Lot",
submit: "Create"
},
edit: {
button: "Edit Lot",
title: "Edit Lot",
submit: "Update"
}
}
} );
when I change Test Name, it has max value and min value of every item. And I'm going to change label of "Test Value" to "Test value(10 ~ 20)".

This discussion has been closed.