Answer the question
In order to leave comments, you need to log in
Yii 1.* how to hide\block next input?
standard form
<div class="row">
<?php if (empty($master)) echo $form->labelEx($model, 'speed'); ?>
<?php if (empty($master)) echo $form->textField($model, 'speed', array('disabled' => $master)); ?>
<?php if (empty($master)) echo $form->error($model, 'speed'); ?>
</div>
<div class="row">
<?php if (empty($master)) echo $form->labelEx($model, 'power'); ?>
<?php if (empty($master)) echo $form->textField($model, 'power', array('disabled' => $master)); ?>
<?php if (empty($master)) echo $form->error($model, 'power'); ?>
</div>
<div id = "check" class="row" display="none">
<?php if (empty($master)) echo $form->labelEx($model, 'reclaimed'); ?>
<?php
if (empty($master))
echo $form->checkBox($model, 'reclaimed', array(
'template' => '{input} {labelTitle}',
'class' => 'chclass',
// 'visible' => 'FALSE',
'onchange' => 'javascript:'
. 'if(this.checked)'
. ' document.getElementById("Engine_recovered").value= new Date().toLocaleDateString() +" "+ new Date().toLocaleTimeString();'
. 'else document.getElementById("Engine_recovered").value="";'
)
);
?>
<?php if (empty($master)) echo $form->error($model, 'reclaimed'); ?>
</div>
Answer the question
In order to leave comments, you need to log in
<?php if (empty($master)) echo $form->textArea($model, 'act_end', array('rows' => 6, 'cols' => 50));
Yii::app()->getClientScript()->registerScript('myscript','$("#Engine_act_end").keyup(function() {
document.getElementById(\'Engine_reclaimed\').style.display="block";
});');
?>
<div class="row" >
<?php if (empty($master)) echo $form->labelEx($model, 'reclaimed'); ?>
<?php
if (empty($master))
echo $form->checkBox($model, 'reclaimed', array(
'template' => '{input} {labelTitle}',
'class' => 'chclass',
// 'visible' => 'FALSE',
'onchange' => 'javascript:'
. 'if(this.checked)'
. ' document.getElementById("Engine_recovered").value= new Date().toLocaleDateString() +" "+ new Date().toLocaleTimeString();'
. 'else document.getElementById("Engine_recovered").value="";'
)
);
?>
<?php if (empty($master)) echo $form->error($model, 'reclaimed'); ?>
</div>
<script type='text/javascript'>
document.getElementById('Engine_reclaimed').style.display = 'none';
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question