I have this code here, which I modified in the getForm function from my Model Class:
$elementHeader='
<fieldset name="reportFilters">';
$elementName = $elementHeader;
$form = $this->loadForm('com_subscription.subscriptions', 'subscriptionsform', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
$jinput = JFactory::getApplication()->input;
$report= $jinput->get('reportId','0',null);
$this->filterlist = $this->getReportFilters($report);
foreach($this->filterlist as $filter_record)
{
$newfield = $this->generateXML($filter_record);
if($newfield=='')
{
}
else
{
$elementName = $elementName.$newfield;
}
}
$elementName = $elementName.
'</fieldset>'
;
$element = new SimpleXMLElement($elementName);
$form->setfield($element);
return $form;
If you would observe, I customized the code to load the form together with the custom fields.
How can I pass this generated form to another function when saving the data from edit form?