Fields Validation not working

Hi,

I have a code that validate fields using formula then triggered by a .click() of javascript…

However, i cannot trap the validation…it just passes the validation without the error trapping then continue with the next line of code…

Is there something wrong with the sequence of my codes?

Thanks,

pen

sample codes:

Save_Only button has:


@Command([ViewRefreshFields]);

@Command([ToolsRunMacro]; “(Submit)”);

@If(Error_Message != NULL; @Return(“”); “”);

FIELD SaveOptions := “1”;

@Command([ViewRefreshFields]);

@Command([FileSave])


document.forms[0].Save_Only.click();//This should validate fields…if satisfied should go to the next line

newWin = ‘/’ + doc.dbpath.value + ‘/’ + doc.Form_To_Open.value + ‘?OpenForm&’ + r ;

window.open(newWin, ‘’, ‘resizable=yes,toolbar=no,scrollbars=yes,width=800,height=1000’);

window.close()