Oracle APEX | How to avoid insert same values into tabular form [JS Client side] ?
Welcome,
Current Issue is:
You want user can’t insert value he inserted same that value before by JS [Client Side without submit page].
Just Edit next code with requests I write it into next PICs.
function checkValues(pThis){
//Just please write column name into colName in our example = f03 & write youw message alert into msgAlert
//Configuratin
var colName = 'f03';
var msgAlert = 'I find match same value you inserted before, #Sorry i will be delete current row !';
//Declaration
var rowId= pThis.id.substr(4);
var chkVal = $('#'+colName+'_'+rowId).val();
var colArray = [];
var chkArray = [];
//Fill column with current values..
var colArray = $('[name="'+colName+'"]').map(function(){
return $(this).val();
}).get();
//Return clear values..
var chkArray = $('#CHK_ARRAY').val().split(",");
//Checking Now..
if(jQuery.inArray(chkVal, chkArray) !== -1){
apex.message.alert(
msgAlert
, function(){
$('#'+colName+'_'+rowId).closest("tr").remove();
});
} else{
$('#CHK_ARRAY').val(colArray);
}
//Regards & All thanks just only for ALLAH.
}
Save & Check Now.. 🙂
Regards,
Amr



