Hi, I have a question. I created a form with a subform. Due to the complex validation, I decided to add form attributes in the getForm method like that:
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_evisit.visit', 'visitform', array(
'control' => 'jform',
'load_data' => $loadData
)
);
if (empty($form))
{
return false;
}
$form->setFieldAttribute('myfield', 'required', 'true');
return $form;
}
And it works ok. The field "myfield" becomes required depending on the scenario.
Unfortunately, this case works only for the current form. Does not work for the subform.
Utilizamos cookies propias y de terceros para mejorar nuestros servicios y mostrarle publicidad relacionada con sus preferencias mediante el análisis de sus hábitos de navegación. Si continua navegando, consideramos que acepta su uso.