Login Register

Getting row and column heading in validation function

Hi,

Thanks to Ravi, I have a function to validate if a user has entered valid data in a cell ...

function onSetEvent(store,item,attr,oldVal,newVal) {
console.debug("About to change "+attr+" from "+oldVal+" to "+newVal);
if(newVal == null || newVal == "") {
alert("Value cannot be empty for " + attr);
store.setValue(item, attr, oldVal, true);
}
}

What I would like to do is modify the alert message to tell them what row the data was entered and what the column heading for the item was that they entered, so that the alert message would read:

alert("Value cannot be empty for row " + rowNum + " for column \"" + columnHeading + "\"");

Any insights are greatly appreciated. Thanks, - Dave