Ending presubmit JavaScript with '//' no longer cancels onclick event

Date: 28 July 2006
Product/Release: LANSA for the Web V11.3
Abstract: Ending presubmit JavaScript with '//' no longer cancels onclick event
Submitted By: LANSA Technical Support


After upgrading to V11.3 (CU3), the submit JavaScript of your clickable images or anchors (hyperlinks) still submit the request even though you have commented out the execution of JavaScript coming after your presubmit JavaScript.


Prior to V11.3 (CU3), section 8.1 of the Web Application Modules (WAMs) Guide incorrectly suggested the use of a double backslash '//' (JavaScript comment) at the end of your presubmit JavaScript as a way to cancel the submit JavaScript for the Clickable Image (std_clickable_image) or Anchor (std_anchor) weblet.

This method doesn't work in 11.3 as the presubmit JavaScript is now run on the onclick() event handler. Commenting out the JavaScript coming after the presubmit JavaScript doesn't cancel the onclick event and the action specified in the href attribute is still performed.


To cancel the submit JavaScript, remove the '//' and instead, append "return false;" to your presubmit JavaScript.

The Web Application Modules (WAMs) Guide has been updated to reflect the proper method for cancelling the onclick event. The updated guide can be downloaded from our document updates page. Refer to Guide Updates

Note: Other Weblets which had the '//' suggestion are not affected, but we recommend you use the proper event cancellation method ("return false;") across all Weblets.