- Fri Jun 21, 2019 5:31 am
#825042
Hi all,
I've a strange behavoir with this piece of code (is an example, in production it doesn't show an alert but it set other values for other fields on the same row):
Anyone can help me to understand why and how I can resolve it?!?
Thanks!
I've a strange behavoir with this piece of code (is an example, in production it doesn't show an alert but it set other values for other fields on the same row):
Code: Select all
In brief, it works fine when I make changes but when I remove a row the content of fieldId contain the old index row.$("form").setOnchange(modifiedForm);
function modifiedForm(fieldId, newVal, oldVal){
console.log("fieldId: " + fieldId + " - newVal: " + newVal + " - oldVal: " + oldVal);
if (oldVal != ''){
rowID = (fieldId.substring(16,fieldId.length)).substring(0,(fieldId.substring(16,fieldId.length)).indexOf(']'));
fieldTemp = ((fieldId.substring(16,fieldId.length)).substring(fieldId.substring(16,fieldId.length).indexOf('[')+1));
field = fieldTemp.substring(0,fieldTemp.length-1);
if (newVal!=oldVal){
if (newVal > 500){
alert("New value>500!");
}
}
}
}
Anyone can help me to understand why and how I can resolve it?!?
Thanks!