문제

I am new in YII, i am wondering if the text-field in YII can made non-editable. If so can anyone answer. I do the following way..

<?php echo $form->labelEx($model,'first_name'); ?>
    <?php echo $form->textField($model,'first_name',array('setEnabled' => false)); ?>

This is not working.

도움이 되었습니까?

해결책

Use readonly instead:

<?php echo $form->textField($model,'first_name',array('readonly' => true)); ?>

For no blinking, go for disabled attribute:

<?php echo $form->textField($model,'first_name',array('disabled' => true)); ?>

Both behave differently so be sure to check that out.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top