By using below java script in OAF. we can validate based on field value and can throw error.
var colspt2 = ‘quoteValidate’.split(\”^\”);
for (var k = 0; k < colspt2.length – 1; k++) {
console.log(‘Checking for quote-number’);
var rowspt2 = colspt2[k].split(\”%\”);
for (i = 0; i < ” + cnt + “; i++) {
console.log(‘Inside for looooooop’);
if (document.getElementById(\”N3:TOLM:\” + i).value == ‘VSAT’ || document.getElementById(\”N3:TOLM:\” + i).value == ‘3G Datacard’ || document.getElementById(\”N3:TOLM:\” + i).value == ‘Wireless’) {
console.log(‘Testing’);
if (document.getElementById(\”N3:\” + rowspt2[0] + \”:\” + i).value == ”) {
alert(rowspt2[1] + \” can’t be null.\”);
document.getElementById(\”N3:\” + rowspt2[0] + \”:\” + i).focus();
return false;
}}
else{
console.log(‘Inside else looooooop’);
}
}
};