-3

一旦有人输入密码,我试图显示一个隐藏的 div。密码不是在查看数据库。现在可以是类似 testpass 的东西。到目前为止,这是我的编码。它可以是任何 java、javascript 或其他东西。我们使用 Coldfusion。我猜 javascript 会是最简单的,但我不确定。我需要添加什么才能进入 testpass 以显示隐藏的内容?安全无所谓。我只是希望用户在向他们显示隐藏的内容之前输入一些内容。

谢谢

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
                        
    <style>
        .buttongrt {
  background-color: #ffffff;
  border: none;
  color: black;
  padding: 6px 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 10px;
  margin: 4px 2px;
  cursor: pointer;
}


</style>

</head>

<body>
<button onclick="hideform()" class="buttongrt">show form</button>

<div id="buttonfgc" style="display:none">
thing that it's hiding</div>
    <br>thing that it's not hiding
    <script type="text/javascript">
function hideform() {
    var T = document.getElementById("buttonfgc"),
        displayValue = "";
    if (T.style.display == "")
        displayValue = "none";

    T.style.display = displayValue;
}
            </script>
        </body>

</html>
4

1 回答 1

0

这确实更倾向于设计问题。您是否已经进行了某种身份验证/用户级别的权限设置?您可以只使用一个 cfif 语句来包装要显示的 div,或者作为设置标签的代码的条件。

只需让它调用返回用户权限级别的服务,然后检查。

于 2021-05-27T17:21:26.323 回答