我有一个登录页面,其中包含用户名和密码,用户类型包含一个管理员和操作员。 当尝试使用操作员登录时,要禁用html中的某些页面。
Login.html:
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div id="login" class="login-panel panel panel-default" style="margin-top:35%;"> <!--hidden">-->
<div class="panel-heading">
<h1 align="center" class="panel-title">Sign In</h1>
</div>
<div class="panel-body">
<form role="form" name="login-form" class="login-form" action="{{url "App.Login"}}" method="post">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Username" id="email_id" name="username" type="email" autofocus>
<span id="errorReport" style="color:blue"></span>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="" onfocus="this.value=''" required="">
</div>
<div class="form-group" align="center">
<input type="radio" name="admin_op" value="1" checked>Administrator
<input type="radio" name="admin_op" value="0">Operator
</div>
<!-- Change this to a button or input when using this as a form -->
<input type="submit" name="submit" id="submit" class="btn btn-lg btn-success btn-block" value="Sign In" onclick='checkEmail();' />
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
Admin.html:
<script language="text/javascript">
document.getElementById("admin").disabled=true;
</script>
<li>
<a id="admin" href="{{url "Admin.Index"}}"><i class="fa fa-wrench"></i>MAP VIEW </a>
</li>