Hello,
newbie here. I am rendering a form fieldset:
public function __construct()
{
// we want to ignore the name passed
parent::__construct('ProductDocumentationLanguageFieldset');
$dh = DoctrineHelper::getInstance();
$this -> setHydrator(new DoctrineHydrator($dh -> getEntityManager(), 'Application\Entity\Language\ProductDocumentationLanguage', false))
-> setObject(new ProductDocumentationLanguage());
$this->setAllowedObjectBindingClass('Application\Entity\Language\ProductDocumentationLanguage');
$this->add(array(
'name' => 'id',
'type' => 'hidden',
));
$this->add(array(
'name' => 'group_id',
'type' => 'hidden',
));
$this->add(array(
'name' => 'product_detail',
'type' => 'hidden',
));
$this->add(array(
'type' => 'DoctrineModule\Form\Element\ObjectSelect',
'name' => 'language',
'attributes' => array(
'class' => 'form-control'
),
'options' => array(
'label' => 'Product language',
'object_manager' => $dh->getEntityManager(),
'target_class' => 'Application\Entity\Language',
'property' => 'name',
'empty_option' => 'Select language',
'is_method' => true,
'find_method' => array(
'name' => 'findAll',
),
),
));
}
this will show me 2 dropdowns on frontend. I need to check, for each of the 2 dropdowns, the selected value on another db table, and if present set the dropdown disabled. How can achieve this?
Thanks a lot