Yii Framework Forum: How to set field size in CMaskedTextField - Yii Framework Forum

Jump to content

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

How to set field size in CMaskedTextField Rate Topic: -----

#1 User is offline   camjohnson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-June 10

Posted 05 September 2010 - 08:02 AM

How does one set the html size= value in:
<?php $this->widget('CMaskedTextField',array('model'=>$model,'attribute'=>'home_phone','mask'=>'999-999-9999', ));?>

Thanks,
0

#2 User is offline   MiksIr 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 01-September 10
  • Location:Russia, Moscow

Posted 05 September 2010 - 08:21 AM

Did you try this?
<?php $this->widget('CMaskedTextField',array('model'=>$model,'attribute'=>'home_phone','mask'=>'999-999-9999','size'=>20 ));?>
0

#3 User is offline   camjohnson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-June 10

Posted 05 September 2010 - 08:32 AM

Yes, and this returns:

Property "CMaskedTextField.size" is not defined.
0

#4 User is offline   qwerty 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 315
  • Joined: 20-November 08

Posted 05 September 2010 - 08:36 AM

Try set width in CSS or

<?php $this->widget('CMaskedTextField',array('model'=>$model,'attribute'=>'home_phone','mask'=>'999-999-9999',htmlOptions=>array('size'=>20) ));?>												

0

#5 User is offline   camjohnson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-June 10

Posted 05 September 2010 - 09:01 AM

Thank you qwerty,
The htmlOptions though needs to be 'htmlOptions'

This solved my problem
0

#6 User is offline   qwerty 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 315
  • Joined: 20-November 08

Posted 05 September 2010 - 09:03 AM

:) I am glad that I could help
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