Hi, i have a paged form,
im creating an HTML field programmatically for an existing multi-page form.
- i would like to add HTML content to the field. how do i do this ?
- i would like this field to appear first on the first page of the existing form. it doesnt seem to work, it always appears last in the last page.
here is my so far code
Thanks,
add_filter( 'gform_pre_render_52', array(&$this, 'load_partial_entries' ) );
function load_partial_entries() {
$form = GFAPI::get_form( 52 );
$new_field_id = GFFormsModel::get_next_field_id( $form['fields'] );
$field = GF_Fields::create( array(
'type' => 'html',
'id' => 10000,
'formId' => $form['id'],
'required' => false,
'label' => 'Service Orders',
'class' => 'col-md-4',
'pageNumber' => 1,
) );
$form['fields'][] = $field;
GFAPI::update_form( $form );
return $form;
}