Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active January 22, 2018 22:38
Show Gist options
  • Save stevewithington/7095706 to your computer and use it in GitHub Desktop.
Save stevewithington/7095706 to your computer and use it in GitHub Desktop.
Mura CMS: Example of how to intercept form data after it's been saved.
<cffunction name="onAfterFormSubmitSave">
<cfargument name="$">
<cfoutput>
<p>The title of this page is: #$.content('title')#<br>
The form submitted is: #$.event('formbean').getValue('title')#</p>
<cfdump var="#$.event('formbean').getAllValues()#">
<cfabort />
</cfoutput>
</cffunction>
@lxcodes
Copy link

lxcodes commented May 19, 2014

@stevewithington, does this actually retrieve the values from a form submitted within a page? If so, where might they be? Currently only getting the form-builder JSON as a body. $.event('formbean').getFields() also does not return anything. Having to revert to using $.event('name')

@mikefeig
Copy link

So how does this work with the async forms starting with 6.2?

@MvdO79
Copy link

MvdO79 commented Jan 22, 2018

For such functionality with async forms check the page through below link for "onFormSubmitResponseRender".
Replace "onAfterFormSubmitSave" with "onFormSubmitResponseRender".

http://docs.getmura.com/v7/mura-developers/mura-events/event-hooks/content-related-events/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment