Hello ppl,
First topic to the forum after a big issue i haven’t solved. So let’s begin. I have this _pform.php
[code [color="#FF0000"][/color]] <div class="row" id="address<?php echo $i;?>">
<?php
echo CHtml::dropDownList('cnid'.$i,'',CHtml::listData(Country::model()->findAll(),'cnid','cname'),
array('prompt'=>'Select Country...','ajax' => array(
'type'=>'GET', //request type
'url'=>CController::createUrl('/country/getcities&param='.$i), //url to call
'update'=>'#Address_'.$i.'_tid', //selector to update
//leave out the data key to pass all form values through
)));
////empty since it will be filled by the other dropdown
//echo $form->labelEx($address,'tid');
//echo CHtml::dropDownList('Adffgghghgs_tid','', array(),array('prompt'=>'Select Town...'));
//echo $form->dropDownList($address,"[$i]tid",array(),array('prompt'=>'Select town..'));
echo CHtml::activeDropDownList($address,"[$i]tid",array(),array('prompt'=>'Select town..'));
//echo $form->error($address,'tid');
echo CHtml::error($address,'tid');
//echo $form->textField($address,"[$i]street",array('size'=>45,'maxlength'=>45));
echo CHtml::activeTextField($address,"[$i]street",array('size'=>45,'maxlength'=>45));
//echo $form->error($address,'street');
echo CHtml::error($address,'street');
//echo $form->textField($address,"[$i]zip");
echo CHtml::activeTextField($address,"[$i]zip");
//echo $form->error($address,'zip');
echo CHtml::error($address,'zip'); ?>
</div>
<?php $i++; ?>
<div class="row" id="address<?php echo $i;?>">
</div>
<div class="row">
<?php //$jsonadd=CJSON::encode($address); ?>
<?php echo CHtml::ajaxLink("label",$this->createUrl('address/moreadd&i='.$i),array('update'=>'#address'.$i ));?>
</div>[/code] (sorry for the uneccessary comments and my bad English )
So it when this form renders for 1st time the first dropdownlist behaves as it supposed to. The request is send the result received.
When i press the label ajaxLink a 2nd form renders (as it supposed) the problem now.
In the [color="#FF0000"]2nd form[/color] rendered the ajax of the 1st dropdown list does not behave as it supposed ( it does not feed the second dropdown.
I used firebug and noticed that the request is not send and obviously a result is not coming.
Any help will be appriciate.