Hi,
How can we prevent a from from saving on clicking the save button until certain validations are met?
Because of certain conditions I cannot make the fields mandatory so I have used java script, but it is not working.
I have tried return false , eventArgs.preventDefault(); but still its not preventing the save
following is my code sample.
if (condition)
{
alert("Message ");
//
preventSave()
//return false;
}
function preventSave(econtext) {
if (econtext != null && econtext.getEventArgs() != null) {
var eventArgs = econtext.getEventArgs();
if (eventArgs.getSaveMode() == 1) {
eventArgs.preventDefault();
}
}
}
Can somebody Please help me to solve this issue ?
Kind Regards.
*This post is locked for comments
I have the same question (0)