生活随笔
收集整理的這篇文章主要介紹了
使下拉框某项不可选的方法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2008年02月22日 02:24 P.M.
| ? <html> ?? <head> ??? <style type="text/css"> ??? option.disabled { color: #999;} ??? </style> ??? <script> ???? function preventSelectDisabled(oSelect) ???? {??? var isOptionDisabled = oSelect.options[oSelect.selectedIndex].disabled;??? ??? if(isOptionDisabled) ??? {?????? ??? oSelect.selectedIndex = oSelect.defaultSelectedIndex;??????? ??? return false;??? ??? }?? ??? else oSelect.defaultSelectedIndex = oSelect.selectedIndex;??? return true; ????? } ??? </script> ?? </head> ?? <body> ?? <select name="Type" id="ReportName" class="textinput" ??????? οnchange='return preventSelectDisabled(this)'> ??????? <option value="reportAsset"> ????????? Positions Summary ??????? </option> ??????? <option value="reportOptions"> ????????? Account Transactions ??????? </option> ??????? <option value="reportOptions"> ????????? Performance Summary ??????? </option> ??????? <option disabled='disabled' class='disabled'> ????????? Asset Allocations ??????? </option> ??????? ??????? <option disabled='disabled' class='disabled'> ????????? Options Tracking ??????? </option> ??????? <option disabled='disabled' class='disabled'> ????????? Historical Variance ??????? </option> ??????? <option disabled='disabled' class='disabled'> ????????? Portfolio Statistics ??????? </option> ????? </select> ????? </body> |
轉(zhuǎn)載于:https://www.cnblogs.com/y0umer/archive/2009/07/07/3839538.html
總結(jié)
以上是生活随笔為你收集整理的使下拉框某项不可选的方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。