JS/Register.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**判断是否是手机号**/
function isPhoneNumber(tel) {
var reg = /^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
return reg.test(tel);
}
function checkForm() {
if ($.trim($("#Account").val()).length == 0) {
alert("帐号不能为空!");
$("#Account").focus();
return false;
}
if ($.trim($("#Password").val()).length == 0) {
alert("密码不能为空!");
$("#Password").focus();
return false;
}
if ($.trim($("#Password").val()).length<6) {
alert("密码长度不能小于6位,请输入大于六位的密码!");
$("#Password").focus();
return false;
}
if ($.trim($("#Identity").val()).length == 0) {
alert("手机号不能为空!");
$("#Identity").focus();
return false;
}
// alert($.trim($("#Identity").val()));
// alert(!isPhoneNumber($.trim($("#Identity").val())));
if (!isPhoneNumber($.trim($("#Identity").val()))) {
alert("输入的手机格式不正确,请正确输入!");
return false;
}
if ($("#UserName") && $.trim($("#UserName").val()).length == 0) {
alert("姓名不能为空!");
$("#UserName").focus();
return false;
}
if ($("#IDNo") && $.trim($("#IDNo").val()).length == 0) {
alert("身份证号不能为空!");
$("#IDNo").focus();
return false;
}
if ($("#address") && $.trim($("#address").val()).length == 0) {
alert("地址不能为空!");
$("#address").focus();
return false;
}
var list = $('input:radio[name="sex"]:checked').val();
$.ajax({
type: "post",
dataType: "json",
contentType: "application/json", //注意:WebMethod()必须加这项,否则客户端数据不会传到服务端
data: "{ 'Account': '" + $.trim($("#Account").val()) + "','Password':'" + $.trim($("#Password").val()) + "','Name':'" + $.trim($("#UserName").val()) + "','Sex':'" + list + "','Identity':'" + $.trim($("#Identity").val()) + "','address':'" + $.trim($("#address").val()) + "','IDNo':'" + $.trim($("#IDNo").val()) + "'}", //注意:data参数可以是string个int类型
url: "Register.aspx/AddRegister",//模拟web服务,提交到方法
// 可选的 async:false,阻塞的异步就是同步
beforeSend: function () { // do something.
// 一般是禁用按钮等防止用户重复提交
//$("#btnClick").attr({disabled:"disabled"});
// 或者是显示loading图片
},
后面还有 24 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
