Hi all,
I am using sfDoctrineForm where 1 select box is dynamic.
In the form i set the 'choices' of the dynamic select box:
$this->widgetSchema['s2'] = new sfWidgetFormChoice(array(
'choices' => Doctrine::getTable('S2')->getRelatedValues()
));
I have this function on Doctrine Table:
class S2Table extends Doctrine_Table
{
public function getRelatedValues($rel_id = 1)
{
$q = $this->createQuery('s')
->where('s.rel_id = ?', $rel_id);
return $q->execute();
}
}
So these select boxes are rendered initially.
<select name="s1">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
</select>
<select name="s2">
<option value="1-1">Value 1-1</option>
<option value="1-2">Value 1-2</option>
</select>
When I change the the first select box value, related values are
retrieved to the Select box 2 via javascript.
What I want is, when the form has errors, on other fields than these 2
select boxes, set the values of the 2nd Select box based on the value
of the 1st one.
One more thing, I get an empty array on $form->getValues() even if the
form isBound() return true.
getValues() returns an array only if the form isValid() == true.
Any help will be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---