Submitting a Process Form with Ajax

Top  Previous  Next

A Process Form can be submitted using the AjaxMgr.submitProcessForm() method as follows

  AjaxMgr.submitProcessForm({
    formName          : 'ProcessForm1'
    ,commandName      : 'Command1'
    ,requiredBlocks   : 'ProcessBlock1' 
    ,submitMethod     : 'Post'
    ,validateInput    : true
    ,beforeSubmitFunc : CallMeBeforeSubmit
    ,confirmMessage   : 'Are you sure?'
    ,requestParams    : {ID:this.value}
    ,busyImage        : 'BI1'
    ,callbackFunc     : CallMeAfter
    ,userData         : {userdata1:data1}
    ,errorHandler     : MyErrorHandler
  }) 

 
See PMgr.submitProcessForm() in  MoreMotion Face API.

 

If a ProcessCommand is provided within the ProcessForm as follows then this method call can be made with less parameters.

  <form method="post" action="ProcessManager.doms"  mo:type="ProcessForm" mo:name="ProcessForm1">

   ...
   <input name="__pcommand" type="hidden"
       mo:name="Command1" mo:type="ProcessCommand"
       mo:props="requiredBlocks:'ProcessBlock1', beforeSubmitFunc: CallMeBeforeSubmit,  validateInput:true,
                 confirmMessage:'Are you sure?', busyImage:'BI1' " />
   ...
 
</form>

 

Submitting a ProcessForm with Ajax (less parameters).

  AjaxMgr.submitProcessForm({
    formName          : 'ProcessForm1'
    ,commandName      : 'Command1'
    ,submitMethod     : 'Post'
    ,requestParams    : {ID:this.value}
    ,callbackFunc     : CallMeAfter
    ,userData         : {userdata1:data1}
    ,errorHandler     : MyErrorHandler
  }) 

The parameters requiredBlocks, beforeSubmitFunc, validateInput, confirmMessage and busyImage will be taken from the ProcessCommand.