單選按鈕提供訪問和撤銷訪問在 HTML 頁面中。單擊提供訪問權限時,它將顯示一些從用戶那里獲取值的選項,這在沒有螞蟻問題的情況下工作,與單擊撤銷訪問按鈕相同,它將顯示一些從用戶那里獲取值的選項。但是這里的問題是撤消訪問權限也從提供訪問單選按鈕中獲取值。知道下面的代碼有什么問題<html><head> <script type="text/javascript"> function empty() { var x; x = document.getElementById("qx").value; y = document.getElementById("pwd").value; if (x == "") { alert("QX number should not be null"); return false; }; if (y == "") { alert("Password should not be null"); return false; }; } </script> <style> .top { position: relative; background-color: #ffffff; height: 68px; } .top1 { top: 110px; left: 476px; position: fixed; background-color: #ffffff; height: 70px; } </style></head><body> <script type="text/javascript"> function displayForm(c) { if (c.value == "1") { document.getElementById("provideContainer").style.visibility = 'visible'; document.getElementById("revokeContainer").style.visibility = 'hidden'; } else if (c.value == "2") { document.getElementById("provideContainer").style.visibility = 'hidden'; document.getElementById("revokeContainer").style.visibility = 'visible'; } else {} } </script> <center> <font color="green"> <h2>Please Select the below option</h2> </font><br> <form> <input value="1" type="radio" name="formselector" onClick="displayForm(this)"></input> <font size="3" color="orange">Provide Access</font> <input value="2" type="radio" name="formselector" onClick="displayForm(this)"></input> <font size="3" color="orange">Revoke Access</font> </form> </div></body></html>
表單容器輸入值問題
蝴蝶不菲
2022-06-16 14:58:07