Yii Framework Forum: Chosen Extension - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chosen Extension Rate Topic: -----

#1 User is offline   Javed Iqbal 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 25-October 11

Posted 16 March 2014 - 01:37 AM

Hi
I have used Chosen extension for product dropdownlist. When I select value from dropdownlist and submit form and if there is validation issue on other inputs on the form then previous selected value from dropdownlist becomes unselected.

View
<?php /** @var BootActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id'=>'verticalForm',
                'focus'=>array($model,'ptype'),
    'htmlOptions'=>array('class'=>'well'),
)); ?>
 
 <p class="note">Fields with <span class="required">*</span> are required.</p>
 <?php echo $form->errorSummary($model); ?>
<?php
$this->widget('ext.chosen.Chosen',array(
//              'model'=> $model,
                'name' => 'inputName', // input name
                'value' => '', // selection
                'data' => CHtml::listData(ProductType::model()->findall("edt IS NULL"), 'id', 'product_type'),
));
<?php echo $form->textFieldRow($model, 'name', array('class'=>'span3')); ?>
<?php echo $form->textFieldRow($model, 'specifications', array('class'=>'span3')); ?>
<div class="form-actions">
                <?php $this->widget('bootstrap.widgets.TbButton', array(
                        'buttonType'=>'submit',
                        'type'=>'primary',
                        'label'=>$model->isNewRecord ? 'Save' : 'Update',
                )); ?>
                <?php echo CHtml::link('<i class="icon-arrow-left"></i> Go Back',Yii::app()->request->urlReferrer,array('class'=>'btn'));?>
        </div> 

Javed Iqbal

Web Developer
syntecX Solution
skype:javedboqo
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users