× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

setFieldAttribute and Subform

4 Anni 11 Mesi fa #4928 da Dariusz
setFieldAttribute and Subform è stato creato da Dariusz
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.

Will somebody lead me?

Si prega Accedi o Crea un account a partecipare alla conversazione.

Tempo creazione pagina: 0.052 secondi
Powered by Forum Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.