Visforms Events for Plugin Development
Some feature request, which we have received in the past, were about individuel business processes. These are features like individual submit handler or specific tasks to be performed on the form data after the form was successfully send, like exporting the submitted data into a text file on the server which is thus continually updated. Sensibly, such features cannot be implemented in the Visforms core code. But with the help of the event system it is possible to develop custom plugins and thus to add custom code to Visforms easily. An other advantage of the usage of plugins is, that they are not affected by Visforms updates.
If you are in need of such an individual feature we were pleased to develop the plugin for you. Just send us a description of what you need and we will make you an offer.
Events supported by Visforms
- onVisformsBeforeHtmlPrepare
- onVisformsAfterHtmlPrepare
- onVisformsAfterCustomtextPrepare
- onVisformsFormPrepare
- onVisformsEditFormPrepare
- onVisformsBeforeFormSave
- onVisformsAfterFormSave
- onVisformsEmailPrepare
- onVisformsBeforeSuccessAction
onVisformsBeforeHtmlPrepare
The HTML code that renders a form field, depending on the field type, the field settings and the forms settings, is created completely inside the Visforms code, now, as a string which is just inserted into the form view. The onVisformsBeforeHtmlPrepare event can be used to change field setting before the HTML string is created.
Parameters
- String $context: com_visforms.field
- Object $field: Reference to the field object
- String $layout: visforms, btdefault, bthorizontal or multicolumn
onVisformsAfterHtmlPrepare
The onVisformsAfterHtmlPrepare event is triggerd after the HTML code string is generated and can be used to post process the HTML string.
Parameters
- String $context: com_visforms.field
- Object $field: Reference to the field object
- String $html: Reference to the HTML string
- String $layout: visforms, btdefault, bthorizontal or multicolumn
onVisformsAfterCustomtextPrepare
The onVisformsAfterCustomtextPrepare event is triggerd after the HTML code, that renders the "Custom Text" of a field is created. It can be used to post process the HTML string.
Parameters
- String $context: com_visforms.field
- String $html: Reference to the HTML string
- String $layout: visforms, btdefault, bthorizontal or multicolumn
onVisformsFormPrepare
The onVisformsFormPrepare event is triggered from inside the form view, before the form is rendered. You can use it to insert individual Javascript code into the form or to adapt form options and to modify the form layout.
Parameters
- String $context: com_visforms.form (form is displayed with menu item) or mod_visforms.form (form is displayed with module) oder plg_vfformview.form (form is displayed with Content Plugin Form View )
- Object $visforms: Reference to the form object
- Object $menu_params: Reference to the menu params
onVisformsEditFormPrepare
The onVisformsEditFormPrepare event is triggered from inside the form edit view, before the form is rendered. You can use it to insert individual Javascript code into the form or to adapt form options and to modify the form layout.
Parameters
- String $context: com_visforms.form
- Object $visforms: Reference to the form object
- Object $menu_params: Reference to the menu params
onVisformsBeforeFormSave
The onVisformsBeforeFormSave event is triggered after the form is submitted and the user inputs are validated and before user inputs are stored in the database.
Parameters
- String $context: com_visforms.form
- Object $visforms: Reference to the form object
- Array $fields: Reference to the fields objects
onVisformsAfterFormSave
The onVisformsAfterFormSave event is triggered after user inputs are stored in the database.
Parameters
- String $context: com_visforms.form
- Object $visforms: Reference to the form object
- Array $fields: Reference to the fields objects
onVisformsEmailPrepare
The onVisformsEmailPrepare event is triggered with differing contexts when Visforms prepares to send the receipt mail and the result mail. It can be used to perform individual tasks on the mails before they are finally send. For example to attach files to the mails.
Parameters
- String $context: com_visforms.form.receiptmail or com_visforms.form.resultmail
- Object $mail: Reference to the mailer object
- Object $visforms: Reference to the form object
onVisformsBeforeSuccessAction
The onVisformsBeforeSuccessAction event is triggered before the form redirect action is performed.
Parameters
- String $context: com_visforms.form
- Object $visforms: Reference to the form object
- Array $fields: Reference to the fields objects