代码如下 | 复制代码 |
<script language="javascript" type="text/javascript"> $(document).ready(function() { $("#btnSubmit").click(function() { Login(); }); }); function Login() { if (Check()) { LoginSuccess(); } } function Check() { if ($("#ksbh").val() == "") { alert("准考证号不能为空!"); $("#ksbh").focus(); return false; } if ($("#Yzm").val() != $.cookie('ValidateCode')) { alert("验证码错误!") $("#Yzm").focus(); return false; } return true; } function LoginSuccess() { $.ajax({ type: "POST", url: "/zk/zkcj201204a", data: { ksbh: $("#ksbh").val()}, beforeSend: function() { $("#msg").html("loading......正在提交请稍候。"); }, success: function(data) { $("#msg").html(data).show(); document.getElementById("valiCode").src = document.getElementById("valiCode").src+'?'; } }); } </script> |
html
代码如下 | 复制代码 |
<div id="lmain"> <div><span class="s1">准考证号:</span><span class="s2"><input id="ksbh" maxlength="12" name="ksbh" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^d]/g,''))" onkeyup="value=value.replace(/[^d]/g,'')" type="text" value="" /></span></div> <div><span class="s1">验证码:</span><span class="s3"><input id="Yzm" name="Yzm" type="text" value="" /><img id="valiCode" style="cursor: pointer;height:22px; line-height:22px; vertical-align:middle;" src="../Validate/GetValidateCode" onclick="this.src=this.src+'?'" alt="看不清?点击更换" /></span></div> <div style=" text-align:center;"><input type="button" id="btnSubmit" value="查询" /> </div> </div> <div id="msg" style=" width:600px;text-align:center; margin-top:20px;"></div> |
时间: 2024-09-20 20:06:26