Javascript代码无效 [英] Javascript code is not working
本文介绍了Javascript代码无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的java代码无效请帮助
我尝试过的事情:
< form method = ' POST'操作= ' ' name = ' 支付'跨度>>
< label>付款方式:< / 标签 >
< select name = ' paymth' id = ' paymth' onChange = ' changetextbox();'>
< option value = ' 存款银行>存款银行< / 选项 >
< ;选项值= ' 在线'>在线转账(网上银行/ RTGS / NEFT /手机银行) < / 选项 >
< option value = ' 支票存款银行>支票存入银行< / 选项 >
< span class =code-keyword>< / select >
< label>存款人姓名*:< / 标签 >
<输入id = ' bd' type = ' text' name = ' depositor'> ;
< label>银行名称:< / label >
< input type = ' text' name = ' bank' required>
< label>日期* :( DD-MM-YYYY)< / label >
< input type = ' text' name = ' date' required>
< label>付款证明* :(扫描副本,存款收据,照片,屏幕截图,交易打印。)< / 标签 >
< br>
< input type = ' file' name = ' 证明'必需>
< input type = ' submit' name = ' payment' value = ' 提交跨度>>
< / 表格 >
< script type = text / javascript>
function changetextbox()
{
if ( document .getElementById( paymth)。value = == 在线){
文档 .getElementById( bd)。disable = ' true';
}
}
< / script>
解决方案
大多数人都普遍理解消息灵通的圈子,当一个程序不工作时,通常是因为它有休息日。
如果问题仍然存在,它可能会开启假期。
根据这里发布的内容,我假设不工作是指付款方式更改为在线转账时...存款人文字框的名称没有被禁用?
看起来剧本中有拼写错误,应该禁用而不是禁用
document .getElementById( bd)。disabled = ' true';
这是一个基于此处发布内容的工作示例: CP_Dropdown_Change - JSFiddle [ ^ ]
my java code is not working please help
What I have tried:
<form method='POST' action='' name='pay'>
<label> Payment method:</label>
<select name='paymth' id='paymth' onChange='changetextbox();' >
<option value='Deposit In Bank'>Deposit In Bank</option>
<option value='Online'>Online Transfer (Net Banking/RTGS/NEFT/Mobile Banking)</option>
<option value='Cheque Deposit In Bank'>Cheque Deposit In Bank</option>
</select>
<label >Name of Depositor*:</label>
<input id='bd' type='text' name='depositor'>
<label >Bank Name:</label>
<input type='text' name='bank' required>
<label >Date*: (DD-MM-YYYY)</label>
<input type='text' name='date' required>
<label>Payment Proof*:(Scan copy, Deposit Receipt, Photo, Screenshot, Transaction Print. )</label>
<br>
<input type='file' name='proof' required>
<input type='submit' name='payment' value='Submit'>
</form>
<script type="text/javascript">
function changetextbox()
{
if (document.getElementById("paymth").value === "Online") {
document.getElementById("bd").disable='true';
}
}
</script>
解决方案
It has been generally understood in most well-informed circles that when a program is "not working", it is usually because it has the day off.
If the problem persists, it may well be on holiday.
Based on what posted here, I assumed the "not working" referring to when the Payment method changed to Online transfer... the Name of depositer textbox didn't get disabled?
Look like there is a typo in the script, it should be disabled instead of disable
document.getElementById("bd").disabled='true';
Here is a working example based on what posted here: CP_Dropdown_Change - JSFiddle[^]
这篇关于Javascript代码无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文