I’ve implemented a cascade of dropdown lists that work fine in the case you arrive at the form with all lists at their default position.
However, in another use case the first list is pre-selected to a certain value to save the user time.
In this circumstance the list has to be changed, and then changed back to the value required to get the dependant list to load, which doesn’t save time! Is there someway to fire off the dependant list population when the list is loaded as well as changed?
Code from form view:
<?php echo CHtml::dropDownList('winery_id',$winid,$wineries,
array('empty' => 'Select winery',
'ajax' => array(
'type'=>'POST', //request type
'url'=>CController::createUrl('Labels/DynamicLabels'), //url to call.
'update'=>'#label_id', //selector to update
Part of the answer is I’d be better with a Typeahead, but still working on that.