gpt4 book ai didi

javascript - onsubmit cakephp图标更改功能

转载 作者:搜寻专家 更新时间:2023-10-31 21:27:22 24 4
gpt4 key购买 nike

 <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>

当我点击提交时,如果我点击批准,则必须显示绿色勾号,否则必须显示红色勾号。我应该做什么?

最佳答案

onChangeApprove 函数放在“批准按钮”的 onchange 事件中。

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")
}
}

关于javascript - onsubmit cakephp图标更改功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34171104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com