Description
Called before any (non-ajax) form is displayed. You may insert additional HTML or fields at the top or, the bottom of the form about to be rendered.
Params
- form name | name of the form about to be rendered.
Example
function onFormDisplay( $form_name ) { /* Add additional form elements at the bottom privacy page */ $elements = array(); if( $form_name == 'jsform-profile-privacy' ) { $obj = new CFormElement(); $obj->label = 'Labe1 1'; $obj->position = 'after'; $obj->html = '<input name="custom1" type="text">'; $elements[] = $obj; $obj = new CFormElement(); $obj->label = 'Labe1 2'; $obj->position = 'after'; $obj->html = '<input name="custom2" type="text">'; $elements[] = $obj; } return $elements; }
The code above will insert 2 new form in the privacy setting page