123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- $(function(){
-
- function bombox(textt){
- $(".bomb-box").fadeIn("slow");
- $(".bomb-box").text(textt);
- var bombwidth = $(".bomb-box").width();
- $(".bomb-box").css({"marginLeft": -(bombwidth+25)/2 + "px"});
- setTimeout(function(){
- $(".bomb-box").fadeOut("slow");
- },4000);
- }
-
- $('.form-group').on('keyup', "#username,#userphone,#usermail,#userorg", function() {
- if($("#username").val() == "" || $("#userphone").val() == "" || $("#usermail").val() == "" || $("#userorg").val() == "") {
- $("#regbtn").attr("disabled",true);
- } else {
- $("#regbtn").attr("disabled",false);
- }
- });
-
-
- $("#regbtn").on('click',function() {
- var hunPhone = $("#userphone").val();
- var hunMail = $("#usermail").val();
- if(hunPhone.length!=11){
- bombox("请输入正确的手机号码");
- return;
- }else if(hunMail.indexOf("@")<0){
- bombox("请输入正确的邮箱地址");
- return;
- }
- completeReg();
- });
-
- function completeReg() {
- $.ajax({
- url:"http://www.ekexiu.com:8080/portal/regcustom.jsp",
- data: {
- username:$("#username").val(),
- userphone: $("#userphone").val(),
- usermail: $("#usermail").val(),
- userorg: $("#userorg").val()
- },
- dataType : "jsonp",
- jsonp: "callback",
- async: false,
- success: function(data) {
- if(data.success) {
- bombox("您的信息提交成功!");
- $(".formblock").hide();
- $(".inviteSucceed").show();
- }
- },
- error: function() {
- bombox("服务器链接超时");
- }
- });
- }
-
-
- });
|