Adding multiple email addresses


I am trying to create a page which is same as gmail compose mail page. So I have "From" and "To" address fields. Those textboxes should be displayed email addresses same as gmail. I have some predefined email addresses and if user dont want to select any email from existing, he can type new email addresses. Is there any extemsion available for that or any way to create a same page as gmail compose mail???

Thanks in advance!!!:)

The select2 extension may do what you need. You can see a demo of the functionality here.

Thank you!!!!

It helps me a lot for my project.


echo CHtml::textField(‘test’,’’,array(‘id’=>‘test’));







I have used this one from given extension.

Can you please guide me that how to increase the size of dropdown coming under textbox??

The size is very small first time then after it is increasing. so how to give default size first time ??

This example shows you how you can apply a CSS class to the drop down list. You could assign a class and set a min-width for it in your CSS file.

In my above mentioned code, I want that 2-3 values always will be selected as by default. I searched in many sites and demo but still I am not able to set the default value.

In this site also given example of default values but still I am not getting default value.

If any property or method is there with this extension to set default value??