Example of JavaScript Structure
The following example checks to see whether the End Time is greater than the Start Time.
This example demonstrates what was explained in the previous sections, to analyze the structure of JavaScript queries. Â In addition, this example references a Java Script library (JSLib.js).
Â
<html><head><title>Example</title> <script type="text/javascript" src="SwiftMEAP/JSLib.js"></script> <script type="text/javascript"> function fieldsOnPreSave(){ return "this.CUSTDT01,this.CUSTDT02"; } function onPreSave(starttime, endtime){ Â Â Â Â if( endtime > starttime ){Â Â Â Â Â Â Â Â Â return true; Â Â Â Â }else{ Â Â Â Â Â Â Â Â window.location = "melt://showAlert/End Date must be greater than Start Date"); return false; Â Â Â Â } }</script></head><body></Body></html>