$form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'registration-register-form',
'htmlOptions'=>array('class'=>'well'),
'enableAjaxValidation'=>true,
'focus'=>array($model,'columname to focus'),
'enableClientValidation'=>true,
));
Page 1 of 1
Focus First Element In Form focus first element in form
#1
Posted 15 March 2013 - 05:23 AM
#2
Posted 16 March 2013 - 02:07 AM
/* Moved from "General Discussion for Yii 1.1.x" to "Tips, Snippets and Tutorials" */
#3
Posted 16 March 2013 - 03:54 PM
By using
you need to add the right columnname for every form... a more general selector could be used here, like those suggested on the focus documentation - http://www.yiiframew...rm#focus-detail
To focus first input element of type text:
To focus first visible and enabled input element
To focus first empty input
'focus'=>array($model,'columname to focus')
you need to add the right columnname for every form... a more general selector could be used here, like those suggested on the focus documentation - http://www.yiiframew...rm#focus-detail
To focus first input element of type text:
'focus'=>'input[type="text"]:first'
To focus first visible and enabled input element
'focus'=>'input:visible:enabled:first'
To focus first empty input
'focus'=>'input:text[value=""]:first'
Find more about me.... btw. Do you know your WAN IP?
#4
Posted 18 March 2013 - 12:32 AM
Maurizio Domba, on 16 March 2013 - 03:54 PM, said:
By using
you need to add the right columnname for every form... a more general selector could be used here, like those suggested on the focus documentation - http://www.yiiframew...rm#focus-detail
To focus first input element of type text:
To focus first visible and enabled input element
To focus first empty input
'focus'=>array($model,'columname to focus')
you need to add the right columnname for every form... a more general selector could be used here, like those suggested on the focus documentation - http://www.yiiframew...rm#focus-detail
To focus first input element of type text:
'focus'=>'input[type="text"]:first'
To focus first visible and enabled input element
'focus'=>'input:visible:enabled:first'
To focus first empty input
'focus'=>'input:text[value=""]:first'
Thanks a lot for your information.
Share this topic:
Page 1 of 1

Help











