How can use Trim/strip whitespaces in yii model
How can use trim in yii model
I have noticed that the fields do not trim/strip whitespaces and I’m wondering how I can do this.I have a form in Yii. Here if I enter trimp values, It gives me an error. That is working fine, But if I add some spaces in front of the field, It does not gives me an error, nor save the data, but display the data as if it is saved. when I append spaces at the end, it gives me an custom error.
Client problem
I tried:”
array('name', 'required', 'trim')This doesn’t work and gives me an error.
Try This :
Trim /strip whitespaces for unique validation
return array( array('name_hindi, name_english', 'required'),
array('name_hindi', 'length', 'max'=>500),
array('name_english', 'length', 'max'=>200),
array('name_english', 'filter', 'filter'=>'trim'),
array('name_hindi', 'filter', 'filter'=>'trim'),
array('name_hindi','unique','message'=>'{attribute}:{value} (Name already created!)'), array('name_english','unique','message'=>'{attribute}:{value} (Name already created!)'), );
guest test post
bbcode
html
http://googlee.te/ simple