Blue
White
Purple
Green
Red
Orange
Blue Light
White Light
Purple Light
Green Light
Red Light
Orange Light
HiI'm looking for a way to alerte user by message beforesave if the field content (date)= todayif click confirm the record go to savingif click cancel the record is aborted.thanks
Something like this:In the JavaScript OnLoad event for the Edit or Add page:Note: Replace DateEntered to your actual field name.
// replace DateEntered to your actual field namethis.on('beforeSave', function(formObj, fieldControlsArr, pageObj){ // get the field data via Javascript control object API var ctrlDateEntered = Runner.getControl(pageid, 'DateEntered'); var DateEntered = ctrlDateEntered.getValue(); var d = new Date() var bool = (d.toDateString() === DateEntered.toDateString()); alert(bool +" => Date Entered:" + DateEntered.toDateString() + " | Today Date:" + d.toDateString()); if (bool) { if (confirm('Save record with date ' + DateEntered.toDateString()+ '?') ) { return true; } else { Runner.delDisabledClass ( pageObj.saveButton ); return false; } }});
Check the online manual for ask before save example: Ask before save Exampleand Get value from control object