How do I make an Ajax call using JS?
I've had a look around the forum but can't find an example of hyf.FMAction.handleAjaxSubmission and the parameters that need passing to it.
I've had a look around the forum but can't find an example of hyf.FMAction.handleAjaxSubmission and the parameters that need passing to it.
RE: JS Ajax Call
Have a look at the bottom of this page of the documentation: http://www.hyfinity.net/mvcdocumentation/MVC/FormMaker%20User%20Guide/Custom%20Script%20Processing%20and%20APIs.html
Hopefully this provides enough info to get you going.
Please note that this is the documentation for v4, and some of the functions listed (eg getFieldValue/setFieldValue) will not be available in older releases.
Regards,
Gerard
RE: JS Ajax Call
--------------------------------------------------
//WM action to call
var objAction = {name: 'Action', option: 'Action', value: 'myAction.do'};
//Group that holds data to be submitted
var objSourceGroup = {name: 'SourceGroup', option: 'AllFormData', value: ''};
//Group to host the result of AJAX call
var objTargetGroup = {name: 'TargetGroup', option: 'PageGroup', value: 'ajax_display_group_name'};
//Validate the data before submitting
var objValidate = {name: 'Validate', option: 'Static', value: 'false'};
//Do the actual call
hyf.FMAction.handleAjaxSubmission(objAction, objSourceGroup, objTargetGroup, objValidate, objEventSource);
------------------------------------------------------
I'm using this bit of code on onload of the main page with custom script to fire off partial pages depending on flags being set or not.