Hi Johann,
Here is the code I am using:
var oldValue = arguments[0];
var newValue = arguments[1];
var msg = "You have not entered a valid time for this shift. \n Please re-enter the time correctly using any of the following formats: \n 1a-2p, 1am-2pm, 115am-215pm, 1:15am-2:15pm."
if( utils.stringPatternCount( newValue , "-" ) > "1")
{
plugins.dialogs.showWarningDialog( 'Error' , msg, 'OK')
return false
}
For some reason, if I leave the field and there are more than one dash, the dialog pops up correctly, but the field value does not revert to the original one, even though the validation failed. Are there some specifics I should put in place so that the validation works?
Thanks in advance,
Ben