Yii Framework Forum: Yii - How To Change Ejuicombobox Option Value In Html - Yii Framework Forum

Jump to content

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

Yii - How To Change Ejuicombobox Option Value In Html Rate Topic: -----

#1 User is offline   Rudra 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 118
  • Joined: 12-July 13

Posted 10 November 2013 - 06:15 AM

I'm new to Yii and I'm using the below code to create a dropdownlist.

<?php

                    $this->widget('ext.combobox.EJuiComboBox', array(
                        'model' => $model,
                        'attribute' => 'max_cost',
                        // data to populate the select. Must be an array.
                        'data' => Yii::app()->params['cost_max_rental'],
                        // options passed to plugin
                        'options' => array(
                            'allowText' => false,
                        ),
                        // Options passed to the text input
                        'htmlOptions' => array('placeholder' => 'Max Cost', 'style'=>'width:70px'),
                    ));
                    
                    //echo $form->dropDownList($model,'city', Yii::app()->params['city'], array('style'=>'width:120px')); 
                    ?>

Now, the HTML generated is

    <select id="SearchForm_max_cost_select" style="display: none;">
    <option value="0"></option>
    <option value="300000.0">300000.0</option>
    <option value="400000.0">400000.0</option>
    <option value="500000.0">500000.0</option>
    <option value="600000.0">600000.0</option>
    </select>  


Now, why is the option value not mentioned as 0, 1, 2, 3. How can I change it
    <select id="SearchForm_max_cost_select" style="display: none;">
        <option value="0"></option>
        <option value="1">300000.0</option>
        <option value="2">400000.0</option>
        <option value="3">500000.0</option>
        <option value="4">600000.0</option>
        </select>  

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