40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
|
function setChosenUpdatedMultiple(elementId, ElementDataCommaSeperated){
|
||
|
var str_array = ElementDataCommaSeperated.split(',');
|
||
|
|
||
|
for (var i = 0; i < str_array.length; i++) {
|
||
|
str_array[i] = str_array[i].replace(/^\s*/, "").replace(/\s*$/, "");
|
||
|
}
|
||
|
|
||
|
$("#"+elementId).val(str_array).trigger("chosen:updated");
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
function getFieldValue(selectCol, tableName, whereIdColNm, WhereIdColVal,resultFieldId){
|
||
|
$.ajax({
|
||
|
url: 'ajax_2.php',
|
||
|
type: "POST",
|
||
|
dataType: 'json',
|
||
|
data: {
|
||
|
"request_type": "selectedTableElementsByIdJSON",
|
||
|
"tableName": tableName,
|
||
|
"idCol": whereIdColNm,
|
||
|
"idColVal": WhereIdColVal,
|
||
|
"resultColumnVal": selectCol
|
||
|
},
|
||
|
success: function(data) {
|
||
|
if (data.length > 0) {
|
||
|
// BootstrapDialog.alert(data);
|
||
|
if(resultFieldId!=''){
|
||
|
$('#'+resultFieldId).val(data);
|
||
|
}
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error getting '+whereIdColNm+' Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|