HTML 頁面中有提供訪問權(quán)限和撤銷訪問權(quán)限的單選按鈕。單擊提供訪問權(quán)限時(shí),它將顯示一些選項(xiàng)以從用戶處獲取值,這在沒有螞蟻問題的情況下工作,與單擊撤銷訪問按鈕相同,它將顯示一些選項(xiàng)以從用戶處獲取值。但這里的問題是撤銷訪問權(quán)限也從提供訪問單選按鈕獲取值。知道下面的代碼有什么問題嗎<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>
表單容器輸入值問題
慕桂英3389331
2023-11-06 15:34:42