Issue
I have this piece of code in my view file
<div>
<div class="column span-4"><?php echo $form->labelEx($model, "name"); ?></div>
<div class="column span-flexible">
<?php echo $this->module->createWidget($form, $model,"name"); ?>
<ul class="errorlist"><li><?php echo $form->error($model, "name"); ?></li></ul>
</div>
</div>
how to make it as read only? or disable it? I have tried already these methods
<?php echo $this->module->createWidget($form, $model,"name",array('htmlOptions' => array('readonly'=>'readonly')); ?>
OR
<?php echo $this->module->createWidget($form, $model,"name",array('htmlOptions'=>array('readOnly' => 'readOnly')); ?>
OR
<?php echo $this->module->createWidget($form, $model,"name",array('htmlOptions'=>array('readonly'=>true)); ?>
None of those worked. what's the solution to fix this in order to make it as read only ?
Solution
you have to write script for that input
document.getElementById("name").readOnly = true;
Answered By - Jenish
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.