Yii Framework Forum: Select2 Extension Problem - Yii Framework Forum

Jump to content

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

Select2 Extension Problem Applying success/error css styles after validation Rate Topic: -----

#1 User is offline   S. Alcántara 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-March 13

Posted 26 March 2013 - 04:05 AM

Hi all,

I am just starting with Yii ;-). In my current (and very first) project, I am using the select2 extension, which is very nice by the way. My problem is that I don't know how to make the conventional success/fail css styles apply after the form validation process. In my case, I added a "required" rule for the select list field in my form...so, in the case of submitting the form with the list empty, I would like the select list background color to change to red (as it happens with the text fields for example). By default, what I am getting is the select list css unchanged (so...the user has not a clear indication of which field was incorrectly filled). FYI, I am using the select2 widget as explained in the documentation:

<?php 
   $this->widget('ext.select2.ESelect2',array(
                'model'=>$model,
                //'attribute'=>'station_ids',
                'attribute'=>'stations',
                'data'=>CHtml::listData(Station::model()->findAll(), 'ID', 'NAME'),
                'options'=>array(
                    'width'=>'resolve',
                ),
                'htmlOptions'=>array(
                     'multiple'=>'multiple',
                     'placeholder'=>'Select stations...',
                ),
               )); 
?>

0

#2 User is offline   kkkyka6s 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 05-March 11

Posted 09 August 2014 - 04:38 PM

Same problem here - no solution so far?
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