mete.ak
(Meteakben)
August 22, 2012, 10:09am
1
hello,
there must be a way to force user to input textbox only lowercase letters. I’m trying to apply a javascipt function “toLower()” that will make case conversion to users input.
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>$this->test,
'source'=>$test,
'options'=>array(
'minLength'=>'2',
)));
Any suggestions?
abennouna
(Abennouna)
August 22, 2012, 10:21am
2
Hello, why would you convert user’s input in an autocomplete field? It’s the source data that matters, isn’t it?
If you are after doing it for any standard textfield, check here: http://stackoverflow.com/questions/7717099/change-lowercase-chars-to-uppercase-with-jquery or here: http://www.plus2net.com/javascript_tutorial/text-onblur.php (you can adapt easily to jQuery of course: http://www.jquery4u.com/dynamic-css-2/jquery-convert-text-uppercaselowercase/ )
By the way, the correct method is toLowerCase() in JavaScript, in case you have a typo there.