Skip to content

Instantly share code, notes, and snippets.

View Luke-Wilson's full-sized avatar

Luke Wilson Luke-Wilson

  • blueriver
  • Northern California, USA
View GitHub Profile
@stevewithington
stevewithington / mura-onBeforeFormSubmitSave-onFormSubmitErrorRender.cfm
Last active September 12, 2019 20:44
Mura CMS : This is an example of how to perform server side validation of Mura CMS form submissions and display an error message to the end user. This leverages the onBeforeFormSubmitSave and the onFormSubmitErrorRender (as of 6.1) methods.
<cfscript>
// Drop this in your Site or Theme eventHandler.cfc
public any function onBeforeFormSubmitSave($) {
// reference to the formBean
var formBean = arguments.$.event('formDataBean');
// example on how to create some errors
var error = '';
var errors = {};