asp密码框分步填写,密码分段输入,防机器人随机禁用输入框

演示图,第一步,6位密码中,先输入两个,另4个禁用,点击提交后,再从另外4个位置中选两可填,另四个禁止
## 标题 ##

提交后,第二个输入框效果

这里写图片描述

第一个auth.asp内容为

<form class="stdform" action="auth2.asp" method="post">
<%
Dim tt , tt2
tt=Split("0,1,2,3,4,5",",")
'随机排序    
randomize   
for ii=0 to 5  
 b=int(rnd()*6)   
 temp=tt(b)   
 tt(b)=tt(ii)   
 tt(ii)=temp 
Next

tt2=tt(2)&","&tt(3)&","&tt(4)&","&tt(5)
 'response.write tt2
%>
      <script type="text/javascript">
$(function(){
//$("#dual<%= tt(2) %>").attr("placeholder","-----");
$("#dual<%= tt(2) %>").attr("title","禁止填写");
$("#dual<%= tt(2) %>").attr("disabled","disabled");
$("#dual<%= tt(2) %>").attr("style","background:#555");

//$("#dual<%= tt(3) %>").attr("placeholder","-----");
$("#dual<%= tt(3) %>").attr("title","禁止填写");
$("#dual<%= tt(3) %>").attr("disabled","disabled");
$("#dual<%= tt(3) %>").attr("style","background:#555");

//$("#dual<%= tt(4) %>").attr("placeholder","-----");
$("#dual<%= tt(4) %>").attr("title","禁止填写");
$("#dual<%= tt(4) %>").attr("disabled","disabled");
$("#dual<%= tt(4) %>").attr("style","background:#555");

//$("#dual<%= tt(5) %>").attr("placeholder","-----");
$("#dual<%= tt(5) %>").attr("title","禁止填写");
$("#dual<%= tt(5) %>").attr("disabled","disabled");
$("#dual<%= tt(5) %>").attr("style","background:#555");
});
</script>
<input name="hiden_var" value="<%= tt2 %>" type="hidden"/>
    <label for="catcha">第二登入密码 </label>
    <input id="dual0"  type="password" name="dualpassword1"    size="1" maxlength="1" value=""  title="" placeholder="1st"/>
    <input id="dual1"  type="password" name="dualpassword2"   size="1" maxlength="1" value=""  placeholder="2nd"/>
    <input id="dual2"  type="password" name="dualpassword3"   size="1" maxlength="1" value=""  placeholder="3rd"/>
    <input id="dual3"  type="password" name="dualpassword4"   size="1" maxlength="1" value=""   placeholder="4th"/>
    <input id="dual4"  type="password" name="dualpassword5"  size="1" maxlength="1" value=""   placeholder="5th"/>
    <input id="dual5"  type="password" name="dualpassword6"   size="1" maxlength="1" value=""  placeholder="6th"/>    
<input type="submit" name="login" value="提交" />
  </form>

第二个auth2.asp内容为

  <form class="stdform" action="auth3.asp" method="post">
<%
Dim tt , tt2
tt=Split(Request.Form("hiden_var"),",")
'随机排序   
randomize   
for ii=0 to 3   
 b=int(rnd()*4)   
 temp=tt(b)   
 tt(b)=tt(ii)   
 tt(ii)=temp 
Next
tt2=tt(2)&","&tt(3)
 'response.write tt2
%>
      <script type="text/javascript">
$(function(){
//$("#dual<%= tt(2) %>").attr("placeholder","-----");
$("#dual<%= tt(2) %>").attr("title","禁止填写");
$("#dual<%= tt(2) %>").attr("disabled","disabled");
$("#dual<%= tt(2) %>").attr("style","background:#555");

//$("#dual<%= tt(3) %>").attr("placeholder","-----");
$("#dual<%= tt(3) %>").attr("title","禁止填写");
$("#dual<%= tt(3) %>").attr("disabled","disabled");
$("#dual<%= tt(3) %>").attr("style","background:#555");


});

</script>
<input name="hiden_var" value="<%= tt2 %>" type="hidden"/>
 <label for="catcha">第二登入密码 </label>

    <input id="dual0"  type="password" name="dualpassword1"    size="1"<% if len(Request.Form("dualpassword1"))>0 Then response.write "style='background:#555'" else response.write "placeholder='1nd' " end If %> maxlength="1" value="<%= Request.Form("dualpassword1") %>"   />
    <input id="dual1"  type="password" name="dualpassword2"   size="1" maxlength="1"<% if len(Request.Form("dualpassword2"))>0 Then response.write " style='background:#555'" else response.write "placeholder='2nd'" end If %> value="<%= Request.Form("dualpassword2") %>"  />
    <input id="dual2"  type="password" name="dualpassword3"   size="1" maxlength="1" <% if len(Request.Form("dualpassword3"))>0 Then response.write " style='background:#555'" else response.write "placeholder='3nd'" end If %>value="<%= Request.Form("dualpassword3") %>"  />
    <input id="dual3"  type="password" name="dualpassword4"   size="1" maxlength="1" <% if len(Request.Form("dualpassword4"))>0 Then response.write " style='background:#555'" else response.write "placeholder='4nd' " end If %>value="<%= Request.Form("dualpassword4") %>"/>
    <input id="dual4"  type="password" name="dualpassword5"  size="1" maxlength="1" <% if len(Request.Form("dualpassword5"))>0 Then response.write "style='background:#555'" else response.write "placeholder='5nd' " end If %>value="<%= Request.Form("dualpassword5") %>"  />
    <input id="dual5"  type="password" name="dualpassword6"   size="1" maxlength="1" <% if len(Request.Form("dualpassword6"))>0 Then response.write " style='background:#555'" else response.write "placeholder='6nd'" end If %>value="<%= Request.Form("dualpassword6") %>"   />
                <input type="submit" name="login" value="提交" />

  </form>

第三个文件内容为auth3.asp

  <form class="stdform" action="act.asp" method="post">
                             <label for="catcha">第二登入密码 </label>         
    <input id="dual0" class="span1" type="password" name="dualpassword1"  required="required"  size="1"<% if len(Request.Form("dualpassword1"))>0 Then response.write "style='background:#555'" else response.write "placeholder='1nd' " end If %> maxlength="1" value="<%= Request.Form("dualpassword1") %>"   />
    <input id="dual1" class="span1" type="password" name="dualpassword2" required="required"  size="1" maxlength="1"<% if len(Request.Form("dualpassword2"))>0 Then response.write " style='background:#555'" else response.write "placeholder='2nd'" end If %> value="<%= Request.Form("dualpassword2") %>"  />
    <input id="dual2" class="span1" type="password" name="dualpassword3" required="required"  size="1" maxlength="1" <% if len(Request.Form("dualpassword3"))>0 Then response.write " style='background:#555'" else response.write "placeholder='3nd'" end If %>value="<%= Request.Form("dualpassword3") %>"  />
    <input id="dual3" class="span1" type="password" name="dualpassword4" required="required"  size="1" maxlength="1" <% if len(Request.Form("dualpassword4"))>0 Then response.write " style='background:#555'" else response.write "placeholder='4nd' " end If %>value="<%= Request.Form("dualpassword4") %>"/>
    <input id="dual4" class="span1" type="password" name="dualpassword5" required="required" size="1" maxlength="1" <% if len(Request.Form("dualpassword5"))>0 Then response.write "style='background:#555'" else response.write "placeholder='5nd' " end If %>value="<%= Request.Form("dualpassword5") %>"  />
    <input id="dual5" class="span1" type="password" name="dualpassword6" required="required"  size="1" maxlength="1" <% if len(Request.Form("dualpassword6"))>0 Then response.write " style='background:#555'" else response.write "placeholder='6nd'" end If %>value="<%= Request.Form("dualpassword6") %>"   />
                <input type="submit" name="login" value="提交" />
  </form>

请打赏谢谢大佬

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值