<td> <select name="paym" id="imo"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <script type="text/javascript"> var a=document.getElementById("imo").value; if (a=="check") document.getElementById("baoxiao").disabled=true; </script> <input type="text" id="baoxiao" maxlength="10" /> </td>
Does the poster want to disable the text box? Let me show you a blog post: Use JQuery custom extension to disable form elements: http://www.ido321.com/397.html
<td> <select name="paym" id="imo"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <script type="text/javascript"> var a=document.getElementById("imo").value; if (a=="check") document.getElementById("baoxiao").disabled=true; </script> <input type="text" id="baoxiao" maxlength="10" /> </td>
<td> <select name="paym" id="imo" onchange="test()"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <script type="text/javascript"> function test(){ var a=document.getElementById("imo").value; if (a=="check") document.getElementById("baoxiao").disabled=true; } </script> <input type="text" id="baoxiao" maxlength="10" /> </td>
js interacts with users through events. For demos, you need to send the complete code, which will help you solve the problem quickly. solve.
If you don’t understand something, check it on Baidu. These are all very basic points.
<!DOCTYPE html><html><head> <meta charset="utf-8"/> <title>test</title> <style type="text/css"> input{ line-height:30px;} .disabled{ border:1px solid #ccc; background: #f1f1f1;} </style></head><body><table> <tr> <td> <select name="paym" id="imo"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <input type="text" id="baoxiao" maxlength="10" /> </td> </tr></table><script type="text/javascript"> var a=document.getElementById("imo"); var txt=document.getElementById("baoxiao"); a.onchange = function(e){ e = e || event; var target = e.target || e.srcElement; if(target.value == 'check'){ txt.className = 'disabled'; txt.disabled = true; } else { txt.className = ''; txt.disabled = false; } }</script></body></html>
js interacts with users through events. For demos, you need to send complete code, which will help you solve the problem quickly.
If you don’t understand something, check it on Baidu. These are all very basic points.
<!DOCTYPE html><html><head> <meta charset="utf-8"/> <title>test</title> <style type="text/css"> input{ line-height:30px;} .disabled{ border:1px solid #ccc; background: #f1f1f1;} </style></head><body><table> <tr> <td> <select name="paym" id="imo"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <input type="text" id="baoxiao" maxlength="10" /> </td> </tr></table><script type="text/javascript"> var a=document.getElementById("imo"); var txt=document.getElementById("baoxiao"); a.onchange = function(e){ e = e || event; var target = e.target || e.srcElement; if(target.value == 'check'){ txt.className = 'disabled'; txt.disabled = true; } else { txt.className = ''; txt.disabled = false; } }</script></body></html>
<td> <select name="paym" id="imo" onchange="test()"> <option value="money" selected>aaa</option> <option value="check" >yyy</option> <option value="card">xxx</option> </select> </td> </tr> <tr> <th height="10%" width="10%" align="center" bgcolor="#1a60a8" style="border:1px solid #000000;"> <font color="#FFFFFF"><b>bbb</b></font></th> <td> <script type="text/javascript"> function test(){ var a=document.getElementById("imo").value; if (a=="check") document.getElementById("baoxiao").disabled=true; } </script> <input type="text" id="baoxiao" maxlength="10" /> </td>