<div class="bit-4 pad-small">
<label>Cheque No</label>
<?php echo $this->Form->input('cheque_no',array('label'=>false,'class'=>'custom-select','options' =>'' ,'empty' => '','required')); ?>
<span>required</span>
</div>
<div class="bit-4 pad-small">
<label>DD No</label>
<?php echo $this->Form->input('dd_no',array('label'=>false,'class'=>'custom-select','options' =>'' ,'empty' => '','required')); ?>
<span>required</span>
</div>
<div class="bit-4 pad-small" style="float:none;">
<br>
<br>
<?php echo $this->Form->input('approve', array(
'type'=>'checkbox',
'style' => 'float:left;',
'label'=>'Approval of order',
'format' => array('before', 'input', 'between', 'label', 'after', 'error' )
) ); ?>
<span>required</span>
</div>
<div class="bit-12" >
<input type="submit" value="Submit" class="form-submit button" />
</div>
</div>当我点击提交,如果我点击批准一个绿色的滴答必须显示,否则一个红色的滴答必须是displayed..What,我做的?
发布于 2015-12-09 05:21:21
将onChangeApprove函数放在“审批按钮”的事件上。
function onChangeApprove(thisObj) {
if ($(thisObj).is(":checked")) {
//change btn color to Green
$("#imgControl").attr("src","/../img/green.png")
} else {
//change btn color to Red
$("#imgControl").attr("src","/../img/red.png")
}
}https://stackoverflow.com/questions/34171104
复制相似问题