1 2function CheckNumberKey(evt) { 3 var charCode = (evt.which) ? evt.which : event.keyCode 4 if (charCode > 31 && (charCode < 48 || charCode > 57)) 5 return false; 6} 7 8$("#backemailotpsend").click(function () { 9 $("#divemailotp").hide(); 10 $("#otpdivemail").show(); 11 $(".radiobox").show(); 12 $("#txtSignInEmailotp").val(''); 13 $("#txtSignInEmailPasswprd").val(''); 14 $("#txtSigninmobile").val(''); 15 $("#txtSignInPhoneOtp").val(''); 16 $("#txtSignInPhonePassword").val(''); 17 $("#errmess").html(''); 18 $("#A3").hide(); 19 $("#sign_heading").text('Sign In'); 20}); 21 22$("#go_backdiv").click(function () { 23 $("#errmess").html(''); 24 $("#signup_formstep-1").show(); 25 $("#signup_formstep-2").hide(); 26 27}); 28//$("#register_Idmobile").click(function() 29//{ 30 31////$("#divmobileotp").show(); 32////$("#otpdivmobile").hide(); 33//$(".radiobox").hide(); 34//$("#sign_heading").text('Verify Your Mobile Number'); 35//}); 36 37$("#signInbyMobilepassword").click(function () { 38 $("#divmobilepassword").show(); 39 $("#divmobileotp").hide(); 40 $("#sign_heading").text('Sign In Password'); 41}); 42$("#signInbyEmailpassword").click(function () { 43 $("#divemailpassword").show(); 44 $("#divemailotp").hide(); 45 $("#sign_heading").text('Sign In Password'); 46}); 47$("#loginemailforgot").click(function () { 48 //alert("hi"); 49 $("#divemailforgot").show(); 50 $("#divmobileforgot").hide(); 51 $("#forgototpdivemail").show(); 52 $("#divemailforgototp").hide(); 53 54 $("#sign_heading").text('Forgot Password'); 55}); 56 57 58//$("#register_Idemailforgot").click(function () { 59// $("#forgototpdivemail").hide(); 60// $("#divemailforgototp").show(); 61// $("#sign_heading").text('Create New Password'); 62//}); 63$("#backemailforgototpsend").click(function () { 64 $(".radioboxforgot").show(); 65 $(".radiobox-FE").click(); 66 $("#forgototpdivemail").show(); 67 $("#divemailforgototp").hide(); 68 $("#txtSignInEmailforgototp").val(''); 69 $("#txtSignInEmailforgotpassword").val(''); 70 $("#txtforgotmobile").val(''); 71 $("#txtforgotPhoneOtp").val(''); 72 $("#txtforgotmobilePassword").val(''); 73 $("#errmess").html(''); 74 $("#A3").hide(); 75 $("#sign_heading").text('Forgot Password'); 76});
77$("#loginmobileforgot").click(function () { 78 //alert("hi"); 79 $("#divmobileforgot").show(); 80 $("#divemailforgot").hide(); 81 $("#forgototpdivmobile").show(); 82 $("#divmobileforgototp").hide(); 83 $("#sign_heading").text('Forgot Password'); 84}); 85//$("#register_Idmobileforgot").click(function () { 86// $("#forgototpdivmobile").hide(); 87// $("#divmobileforgototp").show(); 88// $("#sign_heading").text('Forgot Password'); 89//}); 90$("#backemobileforgototpsend").click(function () { 91 $("#forgototpdivmobile").show(); 92 $(".radioboxforgot").show(); 93 $(".radiobox-fm").click(); 94 $("#txtforgotPhoneOtp").val(''); 95 $("#txtforgotmobilePassword").val(''); 96 $("#txtforgotEmail").val(''); 97 $("#txtSignInEmailforgototp").val(''); 98 $("#txtSignInEmailforgotpassword").val(''); 99 $("#errmess").html(''); 100 $("#A3").hide(); 101 $("#divmobileforgototp").hide(); 102 103 $("#sign_heading").text('Forgot Password'); 104}); 105 106 107$("#full-backemail").click(function () { 108 $("#divemailpassword").hide(); 109 $("#divemailotp").hide(); 110 $("#otpdivemail").show(); 111 $(".radiobox").show(); 112 $("#txtSignInEmailotp").val(''); 113 $("#txtSignInEmailPasswprd").val(''); 114 $("#txtSigninmobile").val(''); 115 $("#txtSignInPhoneOtp").val(''); 116 $("#txtSignInPhonePassword").val(''); 117 $("#errmess").html(''); 118 $("#A3").hide(); 119 $("#sign_heading").text('Sign In'); 120}); 121//$("#createstep-1").click(function() 122//{ 123 124//$("#signup_formstep-1").hide(); 125//$("#signup_formstep-2").show(); 126 127 128//}); 129 130 131 132 133$("#backemobileotpsend").click(function () { 134 135 $("#divmobileotp").hide(); 136 $("#otpdivmobile").show(); 137 $(".radiobox").show(); 138 $("#txtSignInEmail").val(''); 139 $("#txtSignInEmailotp").val(''); 140 $("#txtSignInEmailPasswprd").val(''); 141 142 $("#txtSignInPhoneOtp").val(''); 143 $("#txtSignInPhonePassword").val(''); 144 $("#errmess").html(''); 145 $("#A3").hide(); 146 $("#sign_heading").text('Sign In'); 147}); 148$("#full-backmobile").click(function () { 149 150 $("#divmobileotp").hide(); 151 $("#otpdivmobile").show(); 152 $("#divmobilepassword").hide(); 153 $(".radiobox").show(); 154 $("#txtSignInEmail").val(''); 155 $("#txtSignInEmailotp").val(''); 156 $("#txtSignInEmailPasswprd").val(''); 157 $("#txtSignInPhoneOtp").val(''); 158 $("#txtSignInPhonePassword").val(''); 159 $("#errmess").html(''); 160 $("#A3").hide(); 161 $("#sign_heading").text('Sign In'); 162}); 163 164$(".radiobox-m").click(function () { 165 166 $(".radiobox-m").addClass("active"); 167 $(".radiobox-E").removeClass("active"); 168 $("#txtSignInEmail").val(''); 169}); 170$(".radiobox-E").click(function () { 171 172 $(".radiobox-E").addClass("active"); 173 $(".radiobox-m").removeClass("active"); 174 $("#txtSigninmobile").val(''); 175}); 176 177$(".radiobox-fm").click(function () { 178 179 $(".radiobox-fm").addClass("active"); 180 $(".radiobox-FE").removeClass("active"); 181 $("#txtforgotEmail").val(''); 182 183}); 184$(".radiobox-FE").click(function () { 185 186 $(".radiobox-FE").addClass("active"); 187 $(".radiobox-fm").removeClass("active"); 188 $("#txtforgotmobile").val(''); 189}); 190 191$(".login_btn").click(function () { 192 $(".radiobox").show(); 193 $("#signin_form").show(); 194 $("#divemail").show(); 195 //$("#forgot_form1").hide(); 196 $("#errmess").html(''); 197 clearfield(); 198 $("#loginemail").click(); 199 $("#fortgotpasswordsuccess").hide(); 200 forgothide(); 201 $("#signup_form").hide(); 202 $("#forgot_form").hide(); 203 $("#sign_heading").text('Sign In'); 204 $("#A3").hide(); 205}); 206function clearfield() { 207 $("#txtforgotEmail").val(''); 208 $("#txtSignInEmailforgototp").val(''); 209 $("#txtSignInEmailforgotpassword").val(''); 210 $("#txtforgotmobile").val(''); 211 $("#txtforgotPhoneOtp").val(''); 212 $("#txtforgotmobilePassword").val(''); 213 $("#txtSignInEmail").val(''); 214 $("#txtSignInEmailotp").val(''); 215 $("#txtSignInEmailPasswprd").val(''); 216 $("#txtSigninmobile").val(''); 217 $("#txtSignInPhoneOtp").val(''); 218 $("#txtSignInPhonePassword").val(''); 219 $("#txtSignupEmail").val(''); 220 $("#txtSignupPhone").val(''); 221 $("#txtSignupPassword").val(''); 222 $("#txtsignupFname").val(''); 223 $("#txtSignupLName").val(''); 224 $("#txtSignupcity").val(''); 225 $("#txtSignupPhoneOtp").val(''); 226 $("#txtSignupEmailOtp").val(''); 227 $("#A3").hide(); 228} 229 230$(".register_btn").click(function () { 231 //alert("hi"); 232 $("#signup_form").show(); 233 $("#signup_formstep-1").show(); 234 $("#signin_form").hide(); 235 $("#signup_formstep-2").hide(); 236 $("#fortgotpasswordsuccess").hide(); 237 clearfield(); 238 $("#A3").hide(); 239 $("#errmess").html(''); 240 $("#sign_heading").text('Create New Account'); 241}); 242$(".forgotPassword").click(function () { 243 $("#signup_form").hide(); 244 $("#signin_form").hide(); 245 //$("#forgot_form1").hide(); 246 $("#forgot_form").show(); 247 $(".radiobox-FE").click(); 248 249 $("#divemailforgototp").hide(); 250 $("#divmobileforgototp").hide(); 251 $("#divemailforgot").show(); 252 $("#forgototpdivemail").show(); 253 $(".radioboxforgot").show(); 254 $("#fortgotpasswordsuccess").hide(); 255 $("#errmess").html(''); 256 clearfield(); 257 $("#A3").hide(); 258 $("#sign_heading").text('Forgot Password'); 259}); 260
261$("#backemailotpsend_forgot").click(function () { 262 263 $("#forgot_form").hide(); 264 $("#divemailforgototp").hide(); 265 $("#divmobileforgototp").hide(); 266 $("#signin_form").show(); 267 $(".radiobox").show(); 268 $("#errmess").html(''); 269 $("#A3").hide(); 270 $("#sign_heading").text('Sign In'); 271 272}); 273 274 275 276//$("#verify_email").click(function () { 277// $("#varify_by_mail_or_mobile").show(); 278 279// $("#forgot_form_send_otp").hide(); 280//}); 281 282 283 284//$("#varify_forget_otp").click(function () { 285// $("#varify_by_mail_or_mobile").hide(); 286// $("#verify_div").show(); 287//}); 288function forgothide() { 289 $("#divemailforgot").show(); 290 $("#forgototpdivemail").show(); 291 $("#divemailforgototp").hide(); 292 293 $("#forgototpdivmobile").show(); 294 $("#divmobileforgototp").hide(); 295 $("#divmobileforgot").hide(); 296 $("#fortgotpasswordsuccess").hide(); 297 $("#A3").hide(); 298} 299$('#signModal').on('hidden.bs.modal', function () { 300 //alert("hi"); 301 clearfield(); 302 $("#errmess").html(''); 303 $("#A3").hide(); 304 $("#signup_form").hide(); 305 $("#signup_formstep-2").hide(); 306 $("#signin_form").hide(); 307 $("#divemailotp").hide(); 308 $("#divemailpassword").hide(); 309 $("#divmobile").hide(); 310 $("#divmobileotp").hide(); 311 $("#divmobilepassword").hide(); 312 $("#forgot_form").hide(); 313 $("#divemailforgototp").hide(); 314 $("#divmobileforgot").hide(); 315 $("#divmobileforgototp").hide(); 316 //$("#divemailforgot").show(); 317 //$("#forgototpdivemail").show(); 318 //$("#divemailforgototp").hide(); 319 320 //$("#forgototpdivmobile").show(); 321 //$("#divmobileforgototp").hide(); 322 //$("#divmobileforgot").hide(); 323 //$("#fortgotpasswordsuccess").hide(); 324 //$("#forgot_form").hide(); 325 //$("#signin_form").hide(); 326 //$("#signup_form").hide(); 327 328 //$("#errmess").html(''); 329 //$("#signup_form").hide(); 330 //$("#signin_form").hide(); 331 //$("#forgot_form").hide(); 332 333 $("#txtSignInEmail").val(''); 334 $("#txtforgotEmail").val(''); 335 $("#txtSignInEmailforgototp").val(''); 336 $("#txtSignInEmailforgotpassword").val(''); 337 $("#txtforgotmobile").val(''); 338 $("#txtforgotPhoneOtp").val(''); 339 $("#txtforgotmobilePassword").val(''); 340 $("#txtSignInEmail").val(''); 341 $("#txtSignInEmailotp").val(''); 342 $("#txtSignInEmailPasswprd").val(''); 343 $("#txtSigninmobile").val(''); 344 $("#txtSignInPhoneOtp").val(''); 345 $("#txtSignInPhonePassword").val(''); 346 $("#txtSignupEmail").val(''); 347 $("#txtSignupPhone").val(''); 348 $("#txtSignupPassword").val(''); 349 $("#txtsignupFname").val(''); 350 $("#txtSignupLName").val(''); 351 $("#txtSignupcity").val(''); 352 $("#txtSignupPhoneOtp").val(''); 353 $("#txtSignupEmailOtp").val(''); 354}); 355$(".signclose").on('click', function () { 356 //alert("hi"); 357 clearfield(); 358 $("#errmess").html(''); 359 $("#A3").hide(); 360 $("#signup_form").hide(); 361 $("#signup_formstep-2").hide(); 362 $("#signin_form").hide(); 363 $("#divemailotp").hide(); 364 $("#divemailpassword").hide(); 365 $("#divmobile").hide(); 366 $("#divmobileotp").hide(); 367 $("#divmobilepassword").hide(); 368 $("#forgot_form").hide(); 369 $("#divemailforgototp").hide(); 370 $("#divmobileforgot").hide(); 371 $("#divmobileforgototp").hide(); 372 //$("#divemailforgot").show(); 373 //$("#forgototpdivemail").show(); 374 //$("#divemailforgototp").hide(); 375 376 //$("#forgototpdivmobile").show(); 377 //$("#divmobileforgototp").hide(); 378 //$("#divmobileforgot").hide(); 379 //$("#fortgotpasswordsuccess").hide(); 380 //$("#forgot_form").hide(); 381 //$("#signin_form").hide(); 382 //$("#signup_form").hide(); 383 384 //$("#errmess").html(''); 385 //$("#signup_form").hide(); 386 //$("#signin_form").hide(); 387 //$("#forgot_form").hide(); 388 389 $("#txtSignInEmail").val(''); 390 $("#txtforgotEmail").val(''); 391 $("#txtSignInEmailforgototp").val(''); 392 $("#txtSignInEmailforgotpassword").val(''); 393 $("#txtforgotmobile").val(''); 394 $("#txtforgotPhoneOtp").val(''); 395 $("#txtforgotmobilePassword").val(''); 396 $("#txtSignInEmail").val(''); 397 $("#txtSignInEmailotp").val(''); 398 $("#txtSignInEmailPasswprd").val(''); 399 $("#txtSigninmobile").val(''); 400 $("#txtSignInPhoneOtp").val(''); 401 $("#txtSignInPhonePassword").val(''); 402 $("#txtSignupEmail").val(''); 403 $("#txtSignupPhone").val(''); 404 $("#txtSignupPassword").val(''); 405 $("#txtsignupFname").val(''); 406 $("#txtSignupLName").val(''); 407 $("#txtSignupcity").val(''); 408 $("#txtSignupPhoneOtp").val(''); 409 $("#txtSignupEmailOtp").val(''); 410}); 411 412$("#loginemail").click(function () { 413 //alert("hi"); 414 $("#divemail").show(); 415 $("#divmobile").hide(); 416 $("#errmess").html(''); 417 $("#A3").hide(); 418 419}); 420$("#loginmobile").click(function () { 421 $("#divemail").hide(); 422 $("#divmobile").show(); 423 $("#errmess").html(''); 424 $("#otpdivmobile").show(); 425 $("#A3").hide(); 426 427}); 428 429 430 431$("#Login_via_Password").click(function () { 432 $("#divemail").hide(); 433 $("#divmobile").show(); 434 $("#divmobileotp").hide(); 435 $("#divemailotp").hide(); 436 $("#A3").hide(); 437 438}); 439 440///************************************************************************Sign Up Start********************************************* 441function CheckCapillaryData() { 442 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 443 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/;
444 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 445 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 446 var RegPhNo = /^[0-9,()-]{1,50}$/; 447 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 448 var RegPass = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/; 449 var email = $("#txtSignupEmail"); 450 var Mobile = $("#txtSignupPhone"); 451 var Password = $("#txtSignupPassword"); 452 var countryCode = $("#SignupcountryCode"); 453 454 if ($.trim(email.val()) == "" || email.val() == "Email") { 455 alert("Please enter email id !"); 456 $("#txtSignupEmail").focus(); 457 return false; 458 } 459 else if (!RegEmail.test(email.val())) { 460 alert("Please enter a valid Email Id !"); 461 $("#txtSignupEmail").focus(); 462 return false; 463 } 464 else if ($.trim(Mobile.val()) == "" || Mobile.val() == "Enter Mobile") { 465 alert('Please enter your Mobile'); 466 Mobile.focus(); 467 return false; 468 } 469 else if (Mobile.val().length < 10) { 470 alert('Please enter your valid mobile number'); 471 Mobile.focus(); 472 return false; 473 } 474 else if ($.trim(Password.val()) == "" || Password.val() == "Password") { 475 alert('Please enter your password'); 476 Password.focus(); 477 return false; 478 } 479 480 else if (RegPass.exec(Password.val()) == null) { 481 alert('Password 8 to 15 characters which contain at least one lowercase letter, one uppercase letter, one numeric digit, and one special character'); 482 Password.focus(); 483 return false; 484 } 485 486 else { 487 488 CheckCapData(); 489 } 490} 491function CheckCapData() { 492 var email = $("#txtSignupEmail").val(); 493 var Mobile = $("#txtSignupPhone").val(); 494 var Password = $("#txtSignupPassword").val(); 495 var countryCode = $("#SignupcountryCode").val(); 496 $.ajax({
497 type: "POST", 498 url: '/lthloginsignupsignin.asmx/CheckCapillaryNew', 499 data: "{ 'Email':'" + email + "','CountryCode':'" + countryCode + "','Mobile':'" + Mobile + "','Password': '" + Password + "' }", 500 contentType: "application/json; charset=utf-8", 501 async: true, 502 global: false, 503 beforeSend: function () { 504 $(".loadingPage").fadeIn(); 505 }, 506 success: function (data) { 507 //$(".loadingPage").fadeOut(); 508 if (data.d == "Mobile No. is already exist" || data.d == "Email is already exist" || data.d == "Email and Mobile No. is already exist") { 509 $(".loadingPage").fadeOut(); 510 $("#errmess").html(data.d) 511 } 512 else { 513 //$("#errmess").html('') 514 var t = JSON.parse(data.d); 515 516 var iNum = parseInt(t['createdId']); 517 //alert(iNum); 518 if (iNum > 0) { 519 520 $("#signup_formstep-1").hide(); 521 $("#signup_formstep-2").show(); 522 $(".loadingPage").fadeOut(); 523 $("#errmess").html('') 524 //$('#signModal').modal().hide(); 525 //$("#ValidateOTPModal").modal('show'); 526 527 } 528 529 else { 530 //alet("Error Exist try again"); 531 $("#errmess").html(data.d) 532 $(".loadingPage").fadeOut(); 533 } 534 } 535 //alert(data.d); 536 //if (data.d != "Please Enter Valid Mobile") { 537 538 // var res = data.d.split('|'); 539 540 // if (res[0] == "Success") { 541 // window.location.href = window.location.href; 542 // } 543 // else { 544 // $("#errmess").html(data.d); 545 // return false; 546 // } 547 //} 548 //else { 549 // $("#errmess").html(data.d); 550 // return false; 551 //} 552 }, 553 error: function (jqXHR, textStatus, ex) { } 554 }); 555} 556function SignupNow() { 557 //alert("hi"); 558 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 559 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 560 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 561 //var RegPhNo = /^[0-9,()-]{1,50}$/; 562 var RegPhNo = /^\d{10}$/; 563 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 564 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 565 var title = $("#ddlTitle"); 566 var fname = $("#txtsignupFname"); 567 var lname = $("#txtSignupLName"); 568 var email = $("#txtSignupEmail"); 569 var phone = $("#txtSignupPhone"); 570 var city = $("#txtSignupcity"); 571 var countrycode = $("#SignupcountryCode"); 572 var emailcode = $("#txtSignupEmailOtp"); 573 var mobilecode = $("#txtSignupPhoneOtp"); 574 var termagree = $("#agree_tmc"); 575 576 //if (termagree.prop("checked") == true) { 577 578 // alert("hi"); 579 //} 580 //else { 581 // alert("bye"); 582 //} 583 584 //// var phone = $("#txtSignupPhone").val(); 585 if ($.trim(fname.val()) == "" || fname.val() == "First Name") { 586 alert("Please enter your first name!"); 587 fname.focus(); 588 return false; 589 } 590 else if ($.trim(lname.val()) == "" || lname.val() == "Last Name") { 591 alert("Please enter your last name!"); 592 lname.focus(); 593 return false; 594 } 595 //else if (email.val() == "" || email.val() == "Email") { 596 // alert("Please enter your email!"); 597 // email.focus(); 598 // return false; 599 //} 600 else if ($.trim(city.val()) == "" || city.val() == "City") { 601 alert("Please enter your city!"); 602 city.focus(); 603 return false; 604 } 605 else if ($.trim(mobilecode.val()) == "" || mobilecode.val() == "Enter Mobile OTP") { 606 alert("Please enter mobile OTP.!"); 607 mobilecode.focus(); 608 return false; 609 }
610 else if (mobilecode.val().length < 6) { 611 alert('Please enter valid mobile OTP'); 612 mobilecode.focus(); 613 return false; 614 } 615 else if ($.trim(emailcode.val()) == "" || emailcode.val() == "Enter Email OTP") { 616 alert("Please enter email OTP.!"); 617 emailcode.focus(); 618 return false; 619 } 620 else if (emailcode.val().length < 6) { 621 alert('Please enter valid email OTP'); 622 emailcode.focus(); 623 return false; 624 } 625 if (termagree.prop("checked") == false) { 626 alert('You must agree to the terms first.'); 627 termagree.focus(); 628 return false; 629 } 630 else { 631 SignupNowForUser(); 632 // alert("Success"); 633 634 } 635} 636function SignupNowForUser() { 637 638 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 639 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 640 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 641 //var RegPhNo = /^[0-9,()-]{1,50}$/; 642 var RegPhNo = /^\d{10}$/; 643 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 644 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 645 var title = $("#ddlTitle").val(); 646 var fname = $("#txtsignupFname").val(); 647 var lname = $("#txtSignupLName").val(); 648 var email = $("#txtSignupEmail").val(); 649 var phone = $("#txtSignupPhone").val(); 650 var city = $("#txtSignupcity").val(); 651 var countrycode = $("#SignupcountryCode").val(); 652 var emailcode = $("#txtSignupEmailOtp").val(); 653 var mobilecode = $("#txtSignupPhoneOtp").val(); 654 var password = $("#txtSignupPassword").val(); 655 var termagree = $("#agree_tmc").val(); 656 $.ajax({
657 type: "POST", 658 url: '/lthloginsignupsignin.asmx/ValidateOtpSignupNew', 659 data: "{ 'Title': '" + title + "', 'FName': '" + fname + "', 'LName': '" + lname + "', 'Email': '" + email + "', 'Mobile': '" + phone + "', 'CityName': '" + city + "', 'CodeMob': '" + mobilecode + "', 'CodeEmail': '" + emailcode + "', 'CountryCode': '" + countrycode + "', 'Password': '" + password + "', 'currenturl': '', 'memberid': '' }", 660 contentType: "application/json; charset=utf-8", 661 async: true, 662 //global: false, 663 beforeSend: function () { 664 $(".loadingPage").fadeIn(); 665 }, 666 success: function (data) { 667 //alert(data.d); 668 //var t = JSON.parse(data.d); 669 670 //var iNum = parseInt(t['createdId']); 671 ////alert(iNum); 672 673 if (data.d == "Login create successful") { 674 $("#errmess").html(''); 675 $(".loadingPage").fadeOut(); 676 sendSigninAfterSignUp(); 677 } 678 else { 679 $(".loadingPage").fadeOut(); 680 //alet("Error Exist try again"); 681 $("#errmess").html(data.d) 682 } 683 684 }, 685 error: function (jqXHR, textStatus, ex) { } 686 }); 687} 688 689function SignUpReIssueOtpForMob() { 690 //alert("hi"); 691 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 692 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 693 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 694 var RegPhNo = /^\d{10}$/; 695 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 696 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 697 var phone = $("#txtSignupPhone").val(); 698 var countrycode = $("#SignupcountryCode").val(); 699 $.ajax({
700 type: "POST", 701 url: '/lthloginsignupsignin.asmx/IssueOtpMobileNew', 702 data: "{ 'Mobile': '" + phone + "', 'CountryCode': '" + countrycode + "' }", 703 contentType: "application/json; charset=utf-8", 704 async: true, 705 beforeSend: function () { 706 $(".loadingPage").fadeIn(); 707 }, 708 success: function (data) { 709 $(".loadingPage").fadeOut(); 710 var t = JSON.parse(data.d); 711 712 var iNum = parseInt(t['createdId']); 713 //alert(iNum); 714 if (iNum > 0) { 715 $("#errmess").html(''); 716 } 717 else { 718 719 $("#errmess").html(data.d) 720 } 721 }, 722 error: function (jqXHR, textStatus, ex) { } 723 }); 724 725} 726function SignUpReIssueOtpForEmail() { 727 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 728 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 729 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 730 var RegPhNo = /^\d{10}$/; 731 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 732 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 733 var email = $("#txtSignupEmail").val(); 734 $.ajax({
735 type: "POST", 736 url: '/lthloginsignupsignin.asmx/IssueOtpEmailNew', 737 data: "{ 'Email': '" + email + "'}", 738 contentType: "application/json; charset=utf-8", 739 async: true, 740 beforeSend: function () { 741 $(".loadingPage").fadeIn(); 742 }, 743 success: function (data) { 744 $(".loadingPage").fadeOut(); 745 var t = JSON.parse(data.d); 746 747 var iNum = parseInt(t['createdId']); 748 //alert(iNum); 749 if (iNum > 0) { 750 $("#errmess").html(''); 751 } 752 else { 753 $("#errmess").html(data.d) 754 } 755 }, 756 error: function (jqXHR, textStatus, ex) { } 757 }); 758 759} 760///**************************************************************************Sign Up End********************************************* 761function isNumberKey(evt) { 762 var charCode = (evt.which) ? evt.which : event.keyCode 763 if (charCode > 31 && (charCode < 48 || charCode > 57)) 764 return false; 765 766 return true; 767} 768 769function ValidateSignUpQueryForm() { 770 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 771 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 772 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 773 //var RegPhNo = /^[0-9,()-]{1,50}$/; 774 var RegPhNo = /^\d{10}$/; 775 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 776 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 777 var regularExpression = /^(?=.*\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,25}$/; 778 //alert($("#ddlTitle").val()); 779 var title = $("#ddlTitle").val(); 780 var Fname = $.trim($("#txtsignupFname").val()); 781 var Lname = $.trim($("#txtSignupLName").val()); 782 var email = $.trim($("#txtSignupEmail").val()); 783 var phone = $.trim($("#txtSignupPhone").val()); 784 var city = $.trim($("#txtSignupcity").val()); 785 var countrycode = $("#SignupcountryCode").val(); 786 var password = $("#txtSignupPassword").val(); 787 788 789 //alert(Fname); 790 //alert(Lname); 791 //alert(phone); 792 //alert(city); 793 //alert(countrycode); 794 //alert(password); 795 796 if (Fname == "" || Fname == "Name") { 797 alert("Please enter your first name !"); 798 $("#txtsignupFname").focus(); 799 return false; 800 } 801 else if (Lname == "" || Lname == "Name") { 802 alert("Please enter your last name !"); 803 $("#txtSignupLName").focus(); 804 return false; 805 } 806 else if (email == "" || email == "Email") { 807 alert("Please enter email id !"); 808 $("#txtSignupEmail").focus(); 809 return false; 810 } 811 else if (!AlphaNumeric.test(email)) { 812 alert("Please enter a valid Email Id ! "); 813 $("#txtSignupEmail").focus(); 814 return false; 815 } 816 else if (!RegEmail.test(email)) { 817 alert("Please enter a valid Email Id !"); 818 $("#txtSignupEmail").focus(); 819 return false; 820 } 821 822 else if (phone == "" || phone == "Phone") { 823 alert("Please enter your phone no.!"); 824 $("#txtSignupPhone").focus(); 825 return false; 826 } 827 else if (phone.length < 10) { 828 alert('Please enter your valid phone no.!'); 829 $("#txtSignupPhone").focus(); 830 return false; 831 } 832 else if (city == "" || city == "City") { 833 alert("Please enter your City !"); 834 $("#txtSignupcity").focus(); 835 return false; 836 } 837 else if (password == "" || password == "Password") { 838 alert("Please enter password!"); 839 $("#txtSignupPassword").focus(); 840 return false; 841 } 842 else if (!regularExpression.test(password)) { 843 alert("Password should min 8 letter password, with at least a symbol, upper and lower case letters and a number !"); 844 $("#txtSignupEmail").focus(); 845 return false; 846 } 847 848 849 else { 850 sendSignUpForUser(); 851 // alert("Success"); 852 853 } 854} 855 856function sendSignUpForUser() { 857 var title = $("#ddlTitle").val(); 858 var txtName = $("#txtsignupFname").val(); 859 var LName = $("#txtSignupLName").val(); 860 var Email = $("#txtSignupEmail").val(); 861 var Mobile = $("#txtSignupPhone").val(); 862 var CityName = $("#txtSignupcity").val(); 863 //var countrycode = $("#SignupcountryCode").val(); 864 //var code = $("#txtotp").val(); 865 var password = $("#txtSignupPassword").val(); 866 var pathname = window.location.pathname; 867 868 $.ajax({
869 type: "POST", 870 url: "/LoyaltyService.asmx/SingupMemder", 871 data: "{Title:'" + title + "',FirstName:'" + txtName + "',LastName:'" + LName + "',Mobile:'" + Mobile + "',Email:'" + Email + "',CityName:'" + CityName + "',MemberPassword:'" + password + "', PageUrl:'" + pathname + "'}", 872 contentType: "application/json; charset=utf-8", 873 dataType: "json", 874 processData: true, 875 global: true, 876 async: true, 877 crossDomain: true, 878 cache: false, 879 beforeSend: function () { 880 881 $(".loadingPage").fadeIn(); 882 }, 883 success: function (response) { 884 if (response.d == "Login create successful") { 885 $(".loadingPage").fadeOut(); 886 $("#errmess").html(''); 887 //alert("Login create successful"); 888 //window.location.reload(); 889 sendSigninAfterSignUp(); 890 } else { 891 $(".loadingPage").fadeOut(); 892 $("#errmess").html(response.d); 893 894 } 895 896 }, 897 error: function (jqXHR, textStatus, ex) { } 898 }); 899} 900function sendSigninAfterSignUp() { 901 902 var email = $("#txtSignupEmail").val(); 903 var password = $("#txtSignupPassword").val(); 904 $.ajax({
905 type: "POST", 906 url: '/LoyaltyService.asmx/SingInEmailMember', 907 data: "{ 'Email':'" + email + "','MemberPassword':'" + password + "'}", 908 //data: "{'email':'" + $("[id$=_exampleInputEmail]").val() + "','unsub':" + unsub + "}", 909 contentType: "application/json; charset=utf-8", 910 async: true, 911 beforeSend: function () { 912 $(".loadingPage").fadeIn(); 913 }, 914 success: function (data) { 915 //if (data.d != "Please Enter Valid Email/Mobile") { 916 917 var res = data.d.split('|'); 918 919 if (res[3] == "Success") { 920 $("#errmess").html(''); 921 SetValueServerSide(res[0], res[1], res[2]); 922 //window.location.reload(); 923 //$(".loadingPage").fadeOut(); 924 window.location.href = "https://www.aurikahotels.com/?memberid=" + res[4]; 925 } 926 else { 927 $(".loadingPage").fadeOut(); 928 $("#errmess").html(data.d); 929 return false; 930 } 931 //} 932 //else { 933 // $("#errmess").html(data.d); 934 // return false; 935 //} 936 }, 937 error: function (jqXHR, textStatus, ex) { } 938 }); 939} 940function ValidateSigninQueryForm() { 941 //alert("hi"); 942 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 943 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 944 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 945 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 946 var RegPhNo = /^[0-9,()-]{1,50}$/; 947 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 948 var Email = $("#txtSignInEmail"); 949 var Password = $("#txtSignInEmailPasswprd"); 950 //if (Email.val() == "" || Email.val() == "Login ID/ Registered Email ID") { 951 // alert('Please enter your Email ID/Mobile'); 952 // Email.focus(); 953 // return false; 954 //} 955 //else if (!RegEmail.test(Email.val())) { 956 // alert("Please enter a valid Email ID"); 957 // Email.focus(); 958 // return false; 959 //else 960 if (Password.val() == "" || Password.val() == "Password") { 961 alert('Please enter your password'); 962 Password.focus(); 963 return false; 964 } else { 965 sendSigninEmailPassword(); 966 } 967 968} 969function sendSigninEmailPassword() { 970 971 var email = $("#txtSignInEmail").val(); 972 var password = $("#txtSignInEmailPasswprd").val(); 973 //var chkRememberMe = $("#SignInremember").val(); 974 $.ajax({
975 type: "POST", 976 url: '/LoyaltyService.asmx/SingInEmailMember', 977 //contentType: "application/json; charset=utf-8", 978 data: "{ 'Email':'" + email + "','MemberPassword':'" + password + "'}", 979 //data: "{'email':'" + $("[id$=_exampleInputEmail]").val() + "','unsub':" + unsub + "}", 980 contentType: "application/json; charset=utf-8", 981 async: true, 982 global: false, 983 beforeSend: function () { 984 $(".loadingPage").fadeIn(); 985 }, 986 //processData: true, 987 //global: true, 988 //async: true, 989 //crossDomain: true, 990 //cache: false, 991 success: function (data) { 992 //alert(data.d); 993 //if (data.d != "Please Enter Valid Email/Mobile") { 994 995 var res = data.d.split('|'); 996 997 if (res[3] == "Success") { 998 $("#errmess").html('') 999 SetValueServerSide(res[0], res[1], res[2]); 1000 //$(".loadingPage").fadeOut(); 1001 //window.location.href = window.location.href; 1002 window.location.href = "https://www.aurikahotels.com/"; 1003 //window.location.reload(); 1004 } 1005 else { 1006 $(".loadingPage").fadeOut(); 1007 $("#errmess").html(data.d); 1008 return false; 1009 } 1010 //} 1011 //else { 1012 // $("#errmess").html(data.d); 1013 // return false; 1014 //} 1015 }, 1016 error: function (jqXHR, textStatus, ex) { } 1017 }); 1018 1019} 1020function SetValueServerSide(sessiontoset1, sessiontoset2, sessiontoset3) { 1021 1022 var email = $("#txtSignInEmail").val(); 1023 var password = $("#txtSignInPassword").val(); 1024 //var chkRememberMe = $("#chkRememberMe").val(); 1025 $.ajax({
1026 type: "POST", 1027 url: '/LoyaltyService.asmx/SessionFunctionName', 1028 data: "{ 'sessiontoset1':'" + sessiontoset1 + "','sessiontoset2':'" + sessiontoset2 + "','sessiontoset3':'" + sessiontoset3 + "'}", 1029 contentType: "application/json; charset=utf-8", 1030 async: true, 1031 success: function (data) { 1032 //alert("session set"); 1033 //window.location.reload(); 1034 //window.location.href = "https://www.aurikahotels.com/"; 1035 // } 1036 //else { 1037 // $("#errmess").html(data.d); 1038 // return false; 1039 // } 1040 }, 1041 error: function (jqXHR, textStatus, ex) { } 1042 }); 1043 1044} 1045function ValidateSigninQueryFormMobile() { 1046 //alert("hi"); 1047 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1048 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1049 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1050 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1051 var RegPhNo = /^[0-9,()-]{1,50}$/; 1052 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1053 var Mobile = $("#txtSigninmobile"); 1054 var Password = $("#txtSignInPhonePassword"); 1055 var countryCode = $("#SignincountryCodeMobile"); 1056 1057 //if (Mobile.val() == "" || Mobile.val() == "Enter Mobile") { 1058 // alert('Please enter your Mobile'); 1059 // Mobile.focus(); 1060 // return false; 1061 //} 1062 // //else if (!RegEmail.test(Email.val())) { 1063 // // alert("Please enter a valid Email ID"); 1064 // // Email.focus(); 1065 // // return false; 1066 if (Password.val() == "" || Password.val() == "Password") { 1067 alert('Please enter your password'); 1068 Password.focus(); 1069 return false; 1070 } else { 1071 sendSigninEmailPasswordMobile(); 1072 } 1073 1074} 1075function sendSigninEmailPasswordMobile() { 1076 1077 var mobile = $("#txtSigninmobile").val(); 1078 var password = $("#txtSignInPhonePassword").val(); 1079 var countryCode = $("#SignincountryCodeMobile").val(); 1080 //var chkRememberMe = $("#SignInrememberMobile").val(); 1081 $.ajax({
1082 type: "POST", 1083 url: '/lthloginsignupsignin.asmx/LemonLoginMobileNew', 1084 //contentType: "application/json; charset=utf-8", 1085 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + mobile + "','Passwod':'" + password + "','Isremember': '1' }", 1086 //data: "{'email':'" + $("[id$=_exampleInputEmail]").val() + "','unsub':" + unsub + "}", 1087 contentType: "application/json; charset=utf-8", 1088 async: true, 1089 global: false, 1090 beforeSend: function () { 1091 $(".loadingPage").fadeIn(); 1092 }, 1093 1094 //processData: true, 1095 //global: true, 1096 //async: true, 1097 //crossDomain: true, 1098 //cache: false, 1099 success: function (data) { 1100 1101 1102 //if (data.d != "Please Enter Valid Mobile") { 1103 1104 var res = data.d.split('|'); 1105 1106 if (res[0] == "Success") { 1107 $("#errmess").html('') 1108 window.location.href = "https://www.aurikahotels.com/"; 1109 //window.location.reload(); 1110 //$(".loadingPage").fadeOut(); 1111 1112 //window.location.href = window.location.href; 1113 //var nurl = window.location.href; 1114 //alert(nurl); 1115 // window.location.assign(nurl); 1116 //$(location).attr('href',nurl); 1117 //window.location.replace(window.location.href); 1118 } 1119 else { 1120 $(".loadingPage").fadeOut(); 1121 $("#errmess").html(data.d); 1122 return false; 1123 } 1124 //} 1125 //else { 1126 // $("#errmess").html(data.d); 1127 // return false; 1128 //} 1129 }, 1130 error: function (jqXHR, textStatus, ex) { } 1131 }); 1132 1133} 1134 1135///Sign In by Mobile OTP 1136function SignInOtpMobile() { 1137 //alert("hi"); 1138 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1139 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1140 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1141 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1142 var RegPhNo = /^[0-9,()-]{1,50}$/; 1143 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1144 var Mobile = $("#txtSigninmobile"); 1145 //var Password = $("#txtSignInPasswordMobile"); 1146 var countryCode = $("#SignincountryCodeMobile"); 1147 1148 if (Mobile.val() == "" || Mobile.val() == "Enter Mobile") { 1149 alert('Please enter your Mobile'); 1150 Mobile.focus(); 1151 return false; 1152 } 1153 else if (Mobile.val().length < 10) { 1154 alert('Please enter your mobile number'); 1155 Mobile.focus(); 1156 return false; 1157 } 1158 else { 1159 SignInOtpMobileIssue(); 1160 } 1161 1162} 1163function SignInOtpMobileIssue() { 1164 1165 var mobile = $("#txtSigninmobile").val(); 1166 var countryCode = $("#SignincountryCodeMobile").val(); 1167 $.ajax({
1168 type: "POST", 1169 url: '/lthloginsignupsignin.asmx/SignInIssueOtpMobileNew', 1170 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + mobile + "'}", 1171 contentType: "application/json; charset=utf-8", 1172 async: true, 1173 global: false, 1174 beforeSend: function () { 1175 $(".loadingPage").fadeIn(); 1176 }, 1177 success: function (data) { 1178 1179 if (data.d == "Mobile no. is not registered") { 1180 $(".loadingPage").fadeOut(); 1181 $("#errmess").html('Mobile no. is not registered.') 1182 $("#A3").show(); 1183 } 1184 else { 1185 1186 var t = JSON.parse(data.d); 1187 var iNum = parseInt(t['createdId']); 1188 if (iNum > 0) { 1189 $(".loadingPage").fadeOut(); 1190 $("#errmess").html(''); 1191 $("#A3").hide(); 1192 $("#divmobileotp").show(); 1193 $("#otpdivmobile").hide(); 1194 $(".radiobox").hide(); 1195 $("#sign_heading").text('Verify Your Mobile Number'); 1196 } 1197 else { 1198 $("#A3").hide(); 1199 $(".loadingPage").fadeOut(); 1200 $("#errmess").html(data.d); 1201 } 1202 } 1203 1204 }, 1205 error: function (jqXHR, textStatus, ex) { } 1206 }); 1207 1208} 1209// Sign In by Mobile OTP Validate 1210function SignInOtpMobileValidate() { 1211 //alert("hi"); 1212 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1213 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1214 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1215 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1216 var RegPhNo = /^[0-9,()-]{1,50}$/; 1217 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1218 var Mobile = $("#txtSigninmobile"); 1219 var mobcode = $("#txtSignInPhoneOtp"); 1220 var countryCode = $("#SignincountryCodeMobile"); 1221 1222 if (mobcode.val() == "" || mobcode.val() == "Enter Mobile OTP") { 1223 alert('Please enter your Mobile OTP'); 1224 mobcode.focus(); 1225 return false; 1226 } 1227 if (mobcode.val().length < 6) { 1228 alert('Please enter valid Mobile OTP'); 1229 mobcode.focus(); 1230 return false; 1231 } 1232 else { 1233 SignInOtpMobileIssueValidate(); 1234 } 1235 1236} 1237function SignInOtpMobileIssueValidate() { 1238 1239 var Mobile = $("#txtSigninmobile").val(); 1240 var mobcode = $("#txtSignInPhoneOtp").val(); 1241 var countryCode = $("#SignincountryCodeMobile").val(); 1242 $.ajax({
1243 type: "POST", 1244 url: '/lthloginsignupsignin.asmx/SignInIssueOtpMobileValidateNew', 1245 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + Mobile + "','CodeMob':'" + mobcode + "'}", 1246 contentType: "application/json; charset=utf-8", 1247 async: true, 1248 global: false, 1249 beforeSend: function () { 1250 $(".loadingPage").fadeIn(); 1251 }, 1252 success: function (data) { 1253 1254 var res = data.d.split('|'); 1255 1256 if (res[0] == "Success") { 1257 //$(".loadingPage").fadeOut(); 1258 $("#errmess").html('') 1259 //window.location.reload(); 1260 window.location.href = "https://www.aurikahotels.com/"; 1261 //window.location.href = window.location.href; 1262 } 1263 else { 1264 $(".loadingPage").fadeOut(); 1265 $("#errmess").html(data.d); 1266 return false; 1267 } 1268 }, 1269 error: function (jqXHR, textStatus, ex) { } 1270 }); 1271 1272} 1273///Sign In by Email OTP 1274function SignInOtpEmail() { 1275 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1276 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1277 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1278 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1279 var RegPhNo = /^[0-9,()-]{1,50}$/; 1280 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1281 var Email = $("#txtSignInEmail"); 1282 1283 if (Email.val() == "" || Email.val() == "Enter Email") { 1284 alert('Please enter your Email ID/Mobile'); 1285 Email.focus(); 1286 return false; 1287 } 1288 else if (!RegEmail.test(Email.val())) { 1289 alert("Please enter a valid Email ID"); 1290 Email.focus(); 1291 return false; 1292 } 1293 else { 1294 //$(".loadingPage").fadeIn(); 1295 SignOtpEmailIssue(); 1296 } 1297 1298} 1299function SignOtpEmailIssue() { 1300 ///$(".loadingPage").fadeIn(); 1301 var email = $("#txtSignInEmail").val(); 1302 $.ajax({
1303 type: "POST", 1304 url: '/lthloginsignupsignin.asmx/IssueOtpEmailNew', 1305 data: "{ 'Email':'" + email + "'}", 1306 contentType: "application/json; charset=utf-8", 1307 async: true, 1308 global: false, 1309 beforeSend: function () { 1310 $(".loadingPage").fadeIn(); 1311 }, 1312 success: function (data) { 1313 1314 if (data.d == "Email is not registered") { 1315 $(".loadingPage").fadeOut(); 1316 $("#errmess").html('Email is not registered.'); 1317 $("#A3").show(); 1318 } 1319 else 1320 { 1321 var t = JSON.parse(data.d); 1322 var iNum = parseInt(t['createdId']); 1323 if (iNum > 0) { 1324 $(".loadingPage").fadeOut(); 1325 $("#errmess").html('') 1326 $("#A3").hide(); 1327 $("#divemailotp").show(); 1328 $("#otpdivemail").hide(); 1329 $(".radiobox").hide(); 1330 $("#sign_heading").text('Verify Your Email ID'); 1331 } 1332 else { 1333 $("#A3").hide(); 1334 $(".loadingPage").fadeOut(); 1335 $("#errmess").html(data.d) 1336 } 1337 } 1338 1339 }, 1340 error: function (jqXHR, textStatus, ex) { } 1341 }); 1342 1343} 1344// Sign In by Email OTP Validate 1345function SignInOtpEmailValidate() { 1346 //alert("hi"); 1347 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1348 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1349 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1350 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1351 var RegPhNo = /^[0-9,()-]{1,50}$/; 1352 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1353 var Email = $("#txtSignInEmail"); 1354 var emailcode = $("#txtSignInEmailotp"); 1355 1356 if (emailcode.val() == "" || emailcode.val() == "Enter Email OTP") { 1357 alert('Please enter your Email OTP'); 1358 emailcode.focus(); 1359 return false; 1360 } 1361 if (emailcode.val().length < 6) { 1362 alert('Please enter valid Email OTP'); 1363 emailcode.focus(); 1364 return false; 1365 } 1366 else { 1367 SignInOtpEmailIssueValidate(); 1368 } 1369 1370} 1371function SignInOtpEmailIssueValidate() { 1372 1373 var Email = $("#txtSignInEmail").val(); 1374 var emailcode = $("#txtSignInEmailotp").val(); 1375 $.ajax({
1376 type: "POST", 1377 url: '/lthloginsignupsignin.asmx/SignInIssueOtpEmailValidateNew', 1378 data: "{ 'Email':'" + Email + "','CodeEmail':'" + emailcode + "'}", 1379 async: true, 1380 global: false, 1381 beforeSend: function () { 1382 $(".loadingPage").fadeIn(); 1383 }, 1384 contentType: "application/json; charset=utf-8", 1385 success: function (data) { 1386 var res = data.d.split('|'); 1387 1388 if (res[0] == "Success") { 1389 1390 $("#errmess").html('') 1391 //$(".loadingPage").fadeOut(); 1392 //window.location.href = window.location.href; 1393 //window.location.reload(); 1394 window.location.href = "https://www.aurikahotels.com/"; 1395 } 1396 else { 1397 $(".loadingPage").fadeOut(); 1398 $("#errmess").html(data.d); 1399 return false; 1400 } 1401 }, 1402 error: function (jqXHR, textStatus, ex) { } 1403 }); 1404 1405} 1406 1407function SignUpIssueOtp() { 1408 //alert("hi"); 1409 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1410 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1411 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1412 //var RegPhNo = /^[0-9,()-]{1,50}$/; 1413 var RegPhNo = /^\d{10}$/; 1414 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1415 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 1416 var title = $("#ddlTitle"); 1417 var fname = $("#txtsignupFname"); 1418 var lname = $("#txtSignupLName"); 1419 var email = $("#txtSignupEmail"); 1420 var city = $("#txtSignupcity"); 1421 var countrycode = $("#SignupcountryCode"); 1422 var phone = $("#txtSignupPhone"); 1423 1424 // alert(phone.val()); 1425 //// var phone = $("#txtSignupPhone").val(); 1426 if (fname.val() == "" || fname.val() == "First Name") { 1427 alert("Please enter your first name!"); 1428 fname.focus(); 1429 return false; 1430 } 1431 else if (lname.val() == "" || lname.val() == "Last Name") { 1432 alert("Please enter your last name!"); 1433 lname.focus(); 1434 return false; 1435 } 1436 else if (email.val() == "" || email.val() == "Email") { 1437 alert("Please enter your email!"); 1438 email.focus(); 1439 return false; 1440 } 1441 else if (city.val() == "" || city.val() == "City") { 1442 alert("Please enter your city!"); 1443 city.focus(); 1444 return false; 1445 } 1446 else if (phone.val() == "" || phone.val() == "Phone") { 1447 alert("Please enter your phone no.!"); 1448 phone.focus(); 1449 return false; 1450 } 1451 //else if (phone.val().length < 10) { 1452 // alert('Please enter your valid contact number'); 1453 // phone.focus(); 1454 // return false; 1455 //} 1456 1457 else { 1458 sendOTPForUser(); 1459 // alert("Success"); 1460 1461 } 1462} 1463function sendOTPForUser() { 1464 1465 var Mobile = $("#txtSignupPhone").val(); 1466 var Email = $("#txtSignupEmail").val(); 1467 var CountryCode = $("#SignupcountryCode").val(); 1468 $.ajax({
1469 type: "POST", 1470 url: '/lthloginsignupsignin.asmx/SingupMemderIssueOTPNew', 1471 data: "{ 'Mobile': '" + Mobile + "', 'Email': '" + Email + "', 'CountryCode': '" + CountryCode + "' }", 1472 contentType: "application/json; charset=utf-8", 1473 async: true, 1474 beforeSend: function () { 1475 $(".loadingPage").fadeIn(); 1476 }, 1477 success: function (data) { 1478 1479 var t = JSON.parse(data.d); 1480 1481 var iNum = parseInt(t['createdId']); 1482 //alert(iNum); 1483 if (iNum > 0) { 1484 1485 $("#divotp").show(); 1486 $("#divotp1").show(); 1487 $("#lblotpmob").text('OTP send to mobile-' + $("#txtSignupPhone").val()); 1488 $("#divissueotp").hide(); 1489 $("#register_Id").prop('disabled', false); 1490 $(".loadingPage").fadeOut(); 1491 $("#errmess").html(''); 1492 //$('#signModal').modal().hide(); 1493 //$("#ValidateOTPModal").modal('show'); 1494 1495 } 1496 1497 else { 1498 $(".loadingPage").fadeOut(); 1499 //alet("Error Exist try again"); 1500 $("#errmess").html(data.d) 1501 } 1502 1503 }, 1504 error: function (jqXHR, textStatus, ex) { } 1505 }); 1506} 1507 1508///************************************************************************Create New Password Start********************************************* 1509///Create New Password by Mobile OTP 1510function ForgotOtpMobile() { 1511 //alert("hi"); 1512 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1513 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1514 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1515 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1516 var RegPhNo = /^[0-9,()-]{1,50}$/; 1517 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1518 var Mobile = $("#txtforgotmobile"); 1519 //var Password = $("#txtSignInPasswordMobile"); 1520 var countryCode = $("#forgotcountryCodeMobile"); 1521 1522 1523 if (Mobile.val() == "" || Mobile.val() == "Enter Mobile") { 1524 alert('Please enter your Mobile'); 1525 Mobile.focus(); 1526 return false; 1527 } 1528 else if (Mobile.val().length < 10) { 1529 alert('Please enter valid Mobile'); 1530 Mobile.focus(); 1531 return false; 1532 } 1533 else { 1534 ForgotOtpMobileIssue(); 1535 } 1536 1537} 1538function ForgotOtpMobileIssue() { 1539 1540 1541 var mobile = $("#txtforgotmobile").val(); 1542 var countryCode = $("#forgotcountryCodeMobile").val(); 1543 $.ajax({
1544 type: "POST", 1545 url: '/lthloginsignupsignin.asmx/ForgotMobileIssueOTPNew', 1546 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + mobile + "'}", 1547 contentType: "application/json; charset=utf-8", 1548 async: true, 1549 beforeSend: function () { 1550 $(".loadingPage").fadeIn(); 1551 }, 1552 success: function (data) { 1553 1554 var t = JSON.parse(data.d); 1555 var iNum = parseInt(t['createdId']); 1556 if (iNum > 0) { 1557 $("#errmess").html(''); 1558 $("#forgototpdivmobile").hide(); 1559 $("#divmobileforgototp").show(); 1560 $(".radioboxforgot").hide(); 1561 $("#sign_heading").text('Forgot Password'); 1562 $(".loadingPage").fadeOut(); 1563 } 1564 else { 1565 $("#errmess").html(data.d); 1566 $(".loadingPage").fadeOut(); 1567 } 1568 }, 1569 error: function (jqXHR, textStatus, ex) { } 1570 }); 1571 1572} 1573// Create New Password by Mobile OTP Validate 1574function ForgotOtpMobileValidate() { 1575 //alert("hi"); 1576 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1577 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1578 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1579 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1580 var RegPass = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/; 1581 var RegPhNo = /^[0-9,()-]{1,50}$/; 1582 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1583 var Mobile = $("#txtforgotmobile"); 1584 var mobcode = $("#txtforgotPhoneOtp"); 1585 var countryCode = $("#forgotcountryCodeMobile"); 1586 var password = $("#txtforgotmobilePassword"); 1587 1588 1589 1590 if (mobcode.val() == "" || mobcode.val() == "Enter mobile OTP") { 1591 alert('Please enter your Mobile OTP'); 1592 mobcode.focus(); 1593 return false; 1594 } 1595 if (mobcode.val().length < 6) { 1596 alert('Please enter valid Mobile OTP'); 1597 mobcode.focus(); 1598 return false; 1599 } 1600 if (password.val() == "" || password.val() == "Enter password") { 1601 alert('Please enter your Mobile OTP'); 1602 mobcode.focus(); 1603 return false; 1604 } 1605 else if (RegPass.exec(password.val()) == null) { 1606 alert('Password 8 to 15 characters which contain at least one lowercase letter, one uppercase letter, one numeric digit, and one special character'); 1607 password.focus(); 1608 return false; 1609 } 1610 else { 1611 ForgotOtpMobileIssueValidate(); 1612 } 1613 1614} 1615function ForgotOtpMobileIssueValidate() { 1616 var Mobile = $("#txtforgotmobile").val(); 1617 var mobcode = $("#txtforgotPhoneOtp").val(); 1618 var countryCode = $("#forgotcountryCodeMobile").val(); 1619 var password = $("#txtforgotmobilePassword").val(); 1620 $.ajax({
1621 type: "POST", 1622 url: '/lthloginsignupsignin.asmx/ValidateForgotMobileIssueOTPNew', 1623 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + Mobile + "','Code':'" + mobcode + "','Password':'" + password + "'}", 1624 contentType: "application/json; charset=utf-8", 1625 async: true, 1626 beforeSend: function () { 1627 $(".loadingPage").fadeIn(); 1628 }, 1629 success: function (data) { 1630 //var res = data.d.split('|'); 1631 1632 if (data.d == "Password Reset Successful.") { 1633 $(".loadingPage").fadeOut(); 1634 $("#forgot_form").hide(); 1635 $("#fortgotpasswordsuccess").show(); 1636 $("#errmess").html(''); 1637 //ForgotSignInByMobile(); 1638 } 1639 else { 1640 $(".loadingPage").fadeOut(); 1641 $("#errmess").html(data.d); 1642 return false; 1643 } 1644 }, 1645 error: function (jqXHR, textStatus, ex) { } 1646 }); 1647 1648} 1649function ForgotSignInByMobile() { 1650 var mobile = $("#txtforgotmobile").val(); 1651 var password = $("#txtforgotmobilePassword").val(); 1652 var countryCode = $("#forgotcountryCodeMobile").val(); 1653 //alert(mobile + "|" + password + "|" + countryCode); 1654 //var chkRememberMe = $("#SignInrememberMobile").val(); 1655 $.ajax({
1656 type: "POST", 1657 url: '/lthloginsignupsignin.asmx/LemonLoginMobileNew', 1658 //contentType: "application/json; charset=utf-8", 1659 data: "{ 'CountryCode':'" + countryCode + "','Mobile':'" + mobile + "','Passwod':'" + password + "','Isremember': '1' }", 1660 //data: "{'email':'" + $("[id$=_exampleInputEmail]").val() + "','unsub':" + unsub + "}", 1661 contentType: "application/json; charset=utf-8", 1662 async: true, 1663 beforeSend: function () { 1664 $(".loadingPage").fadeIn(); 1665 }, 1666 //processData: true, 1667 //global: true, 1668 //async: true, 1669 //crossDomain: true, 1670 //cache: false, 1671 success: function (data) { 1672 // alert(data.d); 1673 //if (data.d != "Please Enter Valid Mobile") { 1674 1675 var res = data.d.split('|'); 1676 1677 if (res[0] == "Success") { 1678 //alert(res[0]); 1679 $("#errmess").html(''); 1680 $(".loadingPage").fadeOut(); 1681 window.location.href = "https://www.aurikahotels.com/"; 1682 //window.location.reload(); 1683 //window.location.href = window.location.href; 1684 } 1685 else { 1686 $(".loadingPage").fadeOut(); 1687 $("#errmess").html(data.d); 1688 return false; 1689 } 1690 //} 1691 //else { 1692 // $("#errmess").html(data.d); 1693 // return false; 1694 //} 1695 }, 1696 error: function (jqXHR, textStatus, ex) { } 1697 }); 1698 1699} 1700///Create New Password by Email OTP 1701function ForgotOtpEmail() { 1702 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1703 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1704 var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1705 //var RegPhNo = /^[0-9,()-]{1,50}$/; 1706 var RegPhNo = /^\d{10}$/; 1707 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1708 var AlphaNumeric = /[0-9a-zA-Z' ']{0,}/; 1709 var Email = $("#txtforgotEmail"); 1710 //var password = $("#txtSignInEmailforgotpassword"); 1711 if (Email.val() == "" || Email.val() == "Enter Email") { 1712 alert('Please enter your Email ID'); 1713 Email.focus(); 1714 return false; 1715 } else if (!AlphaNumeric.test(Email.val())) { 1716 alert("Please enter a valid Email Id ! "); 1717 Email.focus(); 1718 return false; 1719 } else if (!RegEmail.test(Email.val())) { 1720 alert("Please enter a valid Email Id !"); 1721 Email.focus(); 1722 return false; 1723 } 1724 //else if (password.val() == "" || password.val() == "Enter Password") { 1725 // alert('Please enter password'); 1726 // password.focus(); 1727 // return false; 1728 //} 1729 else { 1730 ForgotOtpEmailIssue(); 1731 } 1732 1733} 1734function ForgotOtpEmailIssue() { 1735 1736 var Email = $("#txtforgotEmail").val(); 1737 //var emailcode = $("#txtSignInEmailforgototp").val(); 1738 //var password = $("#txtSignInEmailforgotpassword").val(); 1739 $.ajax({
1740 type: "POST", 1741 url: '/LoyaltyService.asmx/ForgotPasswordEmailMember', 1742 data: "{ 'Email':'" + Email + "'}", 1743 contentType: "application/json; charset=utf-8", 1744 async: true, 1745 beforeSend: function () { 1746 $(".loadingPage").fadeIn(); 1747 }, 1748 success: function (data) { 1749 1750 if (data.d == "Password Sent Successfully.") { 1751 //alert("Password Sent Successfully to your registered email id."); 1752 //window.location.reload(); 1753 1754 $("#errmess").html(''); 1755 $(".loadingPage").fadeOut(); 1756 $("#forgototpdivemail").hide(); 1757 $("#divemailforgototp").show(); 1758 $(".radioboxforgot").hide(); 1759 $("#sign_heading").text('Forgot Password'); 1760 1761 //ForgotSignInByEmail(); 1762 //window.location.href = window.location.href; 1763 } else { 1764 $("#errmess").html(data.d); 1765 $(".loadingPage").fadeOut(); 1766 return false; 1767 } 1768 }, 1769 error: function (jqXHR, textStatus, ex) { } 1770 }); 1771} 1772// Create New Password by Email OTP Validate 1773function ForgotOtpEmailValidate() { 1774 //alert("hi"); 1775 var RegEx = /^[a-zA-Z][a-zA-Z ]+$/; 1776 var RegexSpecialCharacter = /^[a-zA-Z][a-zA-Z ][0-9]+$/; 1777 //var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; 1778 var RegEmail = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 1779 var RegPass = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/; 1780 var RegPhNo = /^[0-9,()-]{1,50}$/; 1781 var WebSiteExp = /^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$/; 1782 var Email = $("#txtforgotEmail"); 1783 var emailcode = $("#txtSignInEmailforgototp"); 1784 var password = $("#txtSignInEmailforgotpassword"); 1785 1786 if ($.trim(emailcode.val()) == "" || emailcode.val() == "Enter Email Code") { 1787 alert('Please enter your Email Code'); 1788 emailcode.focus(); 1789 return false; 1790 } 1791 //if ($.trim(emailcode.val()).length < 6) { 1792 // alert('Please enter valid Email OTP'); 1793 // emailcode.focus(); 1794 // return false; 1795 //} 1796 if ($.trim(password.val()) == "" || password.val() == "Enter Password") { 1797 alert('Please enter password'); 1798 password.focus(); 1799 return false; 1800 } 1801 else if (RegPass.exec(password.val()) == null) { 1802 alert('Password 8 to 15 characters which contain at least one lowercase letter, one uppercase letter, one numeric digit, and one special character'); 1803 password.focus(); 1804 return false; 1805 } 1806 else { 1807 ForgotOtpEmailIssueValidate(); 1808 } 1809 1810} 1811function ForgotOtpEmailIssueValidate() { 1812 1813 1814 1815 var Email = $("#txtforgotEmail").val(); 1816 var emailcode = $("#txtSignInEmailforgototp").val(); 1817 var password = $("#txtSignInEmailforgotpassword").val(); 1818 $.ajax({
1819 type: "POST", 1820 url: '/LoyaltyService.asmx/ChangePasswordEmailMember', 1821 data: "{ 'Email':'" + Email + "','AuthCode':'" + emailcode + "','MemberPassword':'" + password + "'}", 1822 contentType: "application/json; charset=utf-8", 1823 async: true, 1824 beforeSend: function () { 1825 $(".loadingPage").fadeIn(); 1826 }, 1827 success: function (data) { 1828 1829 if (data.d == "Password changed Successfully.") { 1830 1831 alert("Password changed Successfully."); 1832 $("#errmess").html(''); 1833 $(".loadingPage").fadeOut(); 1834 window.location.reload(); 1835 //ForgotSignInByEmail(); 1836 //window.location.href = window.location.href; 1837 } else { 1838 $("#errmess").html(data.d); 1839 $(".loadingPage").fadeOut(); 1840 return false; 1841 } 1842 }, 1843 error: function (jqXHR, textStatus, ex) { } 1844 }); 1845} 1846function ForgotSignInByEmail() { 1847 1848 var email = $("#txtforgotEmail").val(); 1849 var password = $("#txtSignInEmailforgotpassword").val(); 1850 //var chkRememberMe = $("#SignInrememberMobile").val(); 1851 $.ajax({
1852 type: "POST", 1853 url: '/lthloginsignupsignin.asmx/LemonLoginNew', 1854 //contentType: "application/json; charset=utf-8", 1855 data: "{ 'UserID':'" + email + "','Passwod':'" + password + "','Isremember': '1' }", 1856 //data: "{'email':'" + $("[id$=_exampleInputEmail]").val() + "','unsub':" + unsub + "}", 1857 contentType: "application/json; charset=utf-8", 1858 async: true, 1859 beforeSend: function () { 1860 $(".loadingPage").fadeIn(); 1861 }, 1862 //processData: true, 1863 //global: true, 1864 //async: true, 1865 //crossDomain: true, 1866 //cache: false, 1867 success: function (data) { 1868 // alert(data.d); 1869 //if (data.d != "Please Enter Valid Mobile") { 1870 1871 var res = data.d.split('|'); 1872 1873 if (res[0] == "Success") { 1874 //alert(res[0]); 1875 $("#errmess").html(''); 1876 $(".loadingPage").fadeOut(); 1877 window.location.href = "https://www.aurikahotels.com/"; 1878 //window.location.reload(); 1879 //window.location.href = window.location.href; 1880 } 1881 else { 1882 $(".loadingPage").fadeOut(); 1883 $("#errmess").html(data.d); 1884 return false; 1885 } 1886 //} 1887 //else { 1888 // $("#errmess").html(data.d); 1889 // return false; 1890 //} 1891 }, 1892 error: function (jqXHR, textStatus, ex) { } 1893 }); 1894 1895} 1896///************************************************************************Create New Password End********************************************* 1897 1898 1899 1900///* ---------------------------- 1901 1902// CustomValidation prototype 1903 1904// - Keeps track of the list of invalidity messages for this input 1905// - Keeps track of what validity checks need to be performed for this input 1906// - Performs the validity checks and sends feedback to the front end 1907 1908//---------------------------- */ 1909 1910//function CustomValidation(input) { 1911// this.invalidities = []; 1912// this.validityChecks = []; 1913 1914// //add reference to the input node 1915// this.inputNode = input; 1916 1917// //trigger method to attach the listener 1918// this.registerListener(); 1919//} 1920 1921//CustomValidation.prototype = { 1922// addInvalidity: function (message) { 1923// this.invalidities.push(message); 1924// }, 1925// getInvalidities: function () { 1926// return this.invalidities.join('. \n'); 1927// }, 1928// checkValidity: function (input) { 1929// for (var i = 0; i < this.validityChecks.length; i++) { 1930 1931// var isInvalid = this.validityChecks[i].isInvalid(input); 1932// if (isInvalid) { 1933// this.addInvalidity(this.validityChecks[i].invalidityMessage); 1934// } 1935 1936// var requirementElement = this.validityChecks[i].element; 1937 1938// if (requirementElement) { 1939// if (isInvalid) { 1940// requirementElement.classList.add('invalid'); 1941// requirementElement.classList.remove('valid'); 1942// } else { 1943// requirementElement.classList.remove('invalid'); 1944// requirementElement.classList.add('valid'); 1945// } 1946 1947// } // end if requirementElement 1948// } // end for 1949// }, 1950// checkInput: function () { // checkInput now encapsulated 1951 1952// this.inputNode.CustomValidation.invalidities = []; 1953// this.checkValidity(this.inputNode); 1954 1955// if (this.inputNode.CustomValidation.invalidities.length === 0 && this.inputNode.value !== '') { 1956// this.inputNode.setCustomValidity(''); 1957// } else { 1958// var message = this.inputNode.CustomValidation.getInvalidities(); 1959// this.inputNode.setCustomValidity(message); 1960// } 1961// }, 1962// registerListener: function () { //register the listener here 1963 1964// var CustomValidation = this; 1965 1966// this.inputNode.addEventListener('keyup', function () { 1967// CustomValidation.checkInput(); 1968// }); 1969 1970 1971// } 1972 1973//};
1974 1975///* ---------------------------- 1976 1977// CustomValidation prototype 1978 1979// - Keeps track of the list of invalidity messages for this input 1980// - Keeps track of what validity checks need to be performed for this input 1981// - Performs the validity checks and sends feedback to the front end 1982 1983//---------------------------- */ 1984 1985//function CustomValidation(input) { 1986// this.invalidities = []; 1987// this.validityChecks = []; 1988 1989// //add reference to the input node 1990// this.inputNode = input; 1991 1992// //trigger method to attach the listener 1993// this.registerListener(); 1994//} 1995 1996//CustomValidation.prototype = { 1997// addInvalidity: function (message) { 1998// this.invalidities.push(message); 1999// }, 2000// getInvalidities: function () { 2001// return this.invalidities.join('. \n'); 2002// }, 2003// checkValidity: function (input) { 2004// for (var i = 0; i < this.validityChecks.length; i++) { 2005 2006// var isInvalid = this.validityChecks[i].isInvalid(input); 2007// if (isInvalid) { 2008// this.addInvalidity(this.validityChecks[i].invalidityMessage); 2009// } 2010 2011// var requirementElement = this.validityChecks[i].element; 2012 2013// if (requirementElement) { 2014// if (isInvalid) { 2015// requirementElement.classList.add('invalid'); 2016// requirementElement.classList.remove('valid'); 2017// } else { 2018// requirementElement.classList.remove('invalid'); 2019// requirementElement.classList.add('valid'); 2020// } 2021 2022// } // end if requirementElement 2023// } // end for 2024// }, 2025// checkInput: function () { // checkInput now encapsulated 2026 2027// this.inputNode.CustomValidation.invalidities = []; 2028// this.checkValidity(this.inputNode); 2029 2030// if (this.inputNode.CustomValidation.invalidities.length === 0 && this.inputNode.value !== '') { 2031// this.inputNode.setCustomValidity(''); 2032// } else { 2033// var message = this.inputNode.CustomValidation.getInvalidities(); 2034// this.inputNode.setCustomValidity(message); 2035// } 2036// }, 2037// registerListener: function () { //register the listener here 2038 2039// var CustomValidation = this; 2040 2041// this.inputNode.addEventListener('keyup', function () { 2042// CustomValidation.checkInput(); 2043// }); 2044 2045 2046// } 2047 2048//}; 2049 2050 2051 2052///* ---------------------------- 2053 2054// Validity Checks 2055 2056// The arrays of validity checks for each input 2057// Comprised of three things 2058// 1. isInvalid() - the function to determine if the input fulfills a particular requirement 2059// 2. invalidityMessage - the error message to display if the field is invalid 2060// 3. element - The element that states the requirement 2061 2062//---------------------------- */ 2063 2064//var usernameValidityChecks = [ 2065// { 2066// isInvalid: function (input) { 2067// return input.value.length < 3; 2068// }, 2069// invalidityMessage: 'This input needs to be at least 3 characters', 2070// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(1)') 2071// }, 2072// { 2073// isInvalid: function (input) { 2074// var illegalCharacters = input.value.match(/[^a-zA-Z0-9]/g); 2075// return illegalCharacters ? true : false; 2076// }, 2077// invalidityMessage: 'Only letters and numbers are allowed', 2078// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(2)') 2079// } 2080//]; 2081 2082//var passwordValidityChecks = [ 2083// { 2084// isInvalid: function (input) { 2085// return input.value.length < 8 | input.value.length > 100; 2086// }, 2087// invalidityMessage: 'This input needs to be between 8 and 100 characters', 2088// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(1)') 2089// }, 2090// { 2091// isInvalid: function (input) { 2092// return !input.value.match(/[0-9]/g); 2093// }, 2094// invalidityMessage: 'At least 1 number is required', 2095// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(2)') 2096// }, 2097// { 2098// isInvalid: function (input) { 2099// return !input.value.match(/[a-z]/g); 2100// }, 2101// invalidityMessage: 'At least 1 lowercase letter is required', 2102// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(3)') 2103// }, 2104// { 2105// isInvalid: function (input) { 2106// return !input.value.match(/[A-Z]/g); 2107// }, 2108// invalidityMessage: 'At least 1 uppercase letter is required', 2109// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(4)') 2110// }, 2111// { 2112// isInvalid: function (input) { 2113// return !input.value.match(/[\!\@\#\$\%\^\&\*]/g); 2114// }, 2115// invalidityMessage: 'You need one of the required special characters', 2116// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(5)') 2117// } 2118//]; 2119 2120//var passwordRepeatValidityChecks = [ 2121// { 2122// isInvalid: function () { 2123// return passwordRepeatInput.value != passwordInput.value; 2124// }, 2125// invalidityMessage: 'This password needs to match the first one' 2126// } 2127//]; 2128 2129 2130///* ---------------------------- 2131 2132// Setup CustomValidation 2133 2134// Setup the CustomValidation prototype for each input 2135// Also sets which array of validity checks to use for that input 2136 2137//---------------------------- */ 2138 2139////var usernameInput = document.getElementById('username'); 2140//var passwordInput = document.getElementById('txtSignupPassword'); 2141////var passwordRepeatInput = document.getElementById('password_repeat'); 2142 2143////usernameInput.CustomValidation = new CustomValidation(usernameInput); 2144////usernameInput.CustomValidation.validityChecks = usernameValidityChecks; 2145 2146//passwordInput.CustomValidation = new CustomValidation(passwordInput); 2147//passwordInput.CustomValidation.validityChecks = passwordValidityChecks; 2148 2149////passwordRepeatInput.CustomValidation = new CustomValidation(passwordRepeatInput); 2150////passwordRepeatInput.CustomValidation.validityChecks = passwordRepeatValidityChecks; 2151 2152 2153 2154 2155///* ---------------------------- 2156 2157// Event Listeners 2158 2159//---------------------------- */ 2160 2161//var inputs = document.querySelectorAll('input:not([type="submit"])'); 2162 2163 2164//var submit = document.querySelector('input[type="submit"'); 2165 2166//var form = document.getElementById('registration'); 2167 2168//function validate() { 2169// for (var i = 0; i < inputs.length; i++) { 2170// inputs[i].CustomValidation.checkInput(); 2171// } 2172//} 2173 2174//submit.addEventListener('click', validate); 2175//form.addEventListener('submit', validate); 2176 2177 2178///* ---------------------------- 2179 2180// CustomValidation prototype 2181 2182// - Keeps track of the list of invalidity messages for this input 2183// - Keeps track of what validity checks need to be performed for this input 2184// - Performs the validity checks and sends feedback to the front end 2185 2186//---------------------------- */ 2187 2188//function CustomValidation(input) { 2189// this.invalidities = []; 2190// this.validityChecks = []; 2191 2192// //add reference to the input node
2193// this.inputNode = input; 2194 2195// //trigger method to attach the listener 2196// this.registerListener(); 2197//} 2198 2199//CustomValidation.prototype = { 2200// addInvalidity: function (message) { 2201// this.invalidities.push(message); 2202// }, 2203// getInvalidities: function () { 2204// return this.invalidities.join('. \n'); 2205// }, 2206// checkValidity: function (input) { 2207// for (var i = 0; i < this.validityChecks.length; i++) { 2208 2209// var isInvalid = this.validityChecks[i].isInvalid(input); 2210// if (isInvalid) { 2211// this.addInvalidity(this.validityChecks[i].invalidityMessage); 2212// } 2213 2214// var requirementElement = this.validityChecks[i].element; 2215 2216// if (requirementElement) { 2217// if (isInvalid) { 2218// requirementElement.classList.add('invalid'); 2219// requirementElement.classList.remove('valid'); 2220// } else { 2221// requirementElement.classList.remove('invalid'); 2222// requirementElement.classList.add('valid'); 2223// } 2224 2225// } // end if requirementElement 2226// } // end for 2227// }, 2228// checkInput: function () { // checkInput now encapsulated 2229 2230// this.inputNode.CustomValidation.invalidities = []; 2231// this.checkValidity(this.inputNode); 2232 2233// if (this.inputNode.CustomValidation.invalidities.length === 0 && this.inputNode.value !== '') { 2234// this.inputNode.setCustomValidity(''); 2235// } else { 2236// var message = this.inputNode.CustomValidation.getInvalidities(); 2237// this.inputNode.setCustomValidity(message); 2238// } 2239// }, 2240// registerListener: function () { //register the listener here 2241 2242// var CustomValidation = this; 2243 2244// this.inputNode.addEventListener('keyup', function () { 2245// CustomValidation.checkInput(); 2246// }); 2247 2248 2249// } 2250 2251//}; 2252 2253 2254 2255///* ---------------------------- 2256 2257// Validity Checks 2258 2259// The arrays of validity checks for each input 2260// Comprised of three things 2261// 1. isInvalid() - the function to determine if the input fulfills a particular requirement 2262// 2. invalidityMessage - the error message to display if the field is invalid 2263// 3. element - The element that states the requirement 2264 2265//---------------------------- */ 2266 2267//var usernameValidityChecks = [ 2268// { 2269// isInvalid: function (input) { 2270// return input.value.length < 3; 2271// }, 2272// invalidityMessage: 'This input needs to be at least 3 characters', 2273// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(1)') 2274// }, 2275// { 2276// isInvalid: function (input) { 2277// var illegalCharacters = input.value.match(/[^a-zA-Z0-9]/g); 2278// return illegalCharacters ? true : false; 2279// }, 2280// invalidityMessage: 'Only letters and numbers are allowed', 2281// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(2)') 2282// } 2283//]; 2284 2285//var passwordValidityChecks = [ 2286// { 2287// isInvalid: function (input) { 2288// return input.value.length < 8 | input.value.length > 100; 2289// }, 2290// invalidityMessage: 'This input needs to be between 8 and 100 characters', 2291// element: document.querySelector('label[for="txtSignInEmailforgotpassword"] .input-requirements li:nth-child(1)') 2292// }, 2293// { 2294// isInvalid: function (input) { 2295// return !input.value.match(/[0-9]/g); 2296// }, 2297// invalidityMessage: 'At least 1 number is required', 2298// element: document.querySelector('label[for="txtSignInEmailforgotpassword"] .input-requirements li:nth-child(2)') 2299// }, 2300// { 2301// isInvalid: function (input) { 2302// return !input.value.match(/[a-z]/g); 2303// }, 2304// invalidityMessage: 'At least 1 lowercase letter is required', 2305// element: document.querySelector('label[for="txtSignInEmailforgotpassword"] .input-requirements li:nth-child(3)') 2306// }, 2307// { 2308// isInvalid: function (input) { 2309// return !input.value.match(/[A-Z]/g); 2310// }, 2311// invalidityMessage: 'At least 1 uppercase letter is required', 2312// element: document.querySelector('label[for="txtSignInEmailforgotpassword"] .input-requirements li:nth-child(4)') 2313// }, 2314// { 2315// isInvalid: function (input) { 2316// return !input.value.match(/[\!\@\#\$\%\^\&\*]/g); 2317// }, 2318// invalidityMessage: 'You need one of the required special characters', 2319// element: document.querySelector('label[for="txtSignInEmailforgotpassword"] .input-requirements li:nth-child(5)') 2320// } 2321//]; 2322 2323//var passwordRepeatValidityChecks = [ 2324// { 2325// isInvalid: function () { 2326// return passwordRepeatInput.value != passwordInput.value; 2327// }, 2328// invalidityMessage: 'This password needs to match the first one' 2329// } 2330//]; 2331 2332 2333///* ---------------------------- 2334 2335// Setup CustomValidation 2336 2337// Setup the CustomValidation prototype for each input 2338// Also sets which array of validity checks to use for that input 2339 2340//---------------------------- */ 2341 2342////var usernameInput = document.getElementById('username'); 2343//var passwordInput = document.getElementById('txtSignInEmailforgotpassword'); 2344////var passwordRepeatInput = document.getElementById('password_repeat'); 2345 2346////usernameInput.CustomValidation = new CustomValidation(usernameInput); 2347////usernameInput.CustomValidation.validityChecks = usernameValidityChecks; 2348 2349//passwordInput.CustomValidation = new CustomValidation(passwordInput); 2350//passwordInput.CustomValidation.validityChecks = passwordValidityChecks; 2351 2352////passwordRepeatInput.CustomValidation = new CustomValidation(passwordRepeatInput); 2353////passwordRepeatInput.CustomValidation.validityChecks = passwordRepeatValidityChecks; 2354 2355 2356 2357 2358///* ---------------------------- 2359 2360// Event Listeners 2361 2362//---------------------------- */ 2363 2364//var inputs = document.querySelectorAll('input:not([type="submit"])'); 2365 2366 2367//var submit = document.querySelector('input[type="submit"'); 2368//var form = document.getElementById('registration1'); 2369 2370//function validate() { 2371// for (var i = 0; i < inputs.length; i++) { 2372// inputs[i].CustomValidation.checkInput(); 2373// } 2374//} 2375 2376//submit.addEventListener('click', validate); 2377//form.addEventListener('submit', validate); 2378 2379 2380 2381 2382///* ---------------------------- 2383 2384// CustomValidation prototype 2385 2386// - Keeps track of the list of invalidity messages for this input 2387// - Keeps track of what validity checks need to be performed for this input 2388// - Performs the validity checks and sends feedback to the front end 2389 2390//---------------------------- */ 2391 2392//function CustomValidation(input) { 2393// this.invalidities = []; 2394// this.validityChecks = []; 2395 2396// //add reference to the input node
2397// this.inputNode = input; 2398 2399// //trigger method to attach the listener 2400// this.registerListener(); 2401//} 2402 2403//CustomValidation.prototype = { 2404// addInvalidity: function (message) { 2405// this.invalidities.push(message); 2406// }, 2407// getInvalidities: function () { 2408// return this.invalidities.join('. \n'); 2409// }, 2410// checkValidity: function (input) { 2411// for (var i = 0; i < this.validityChecks.length; i++) { 2412 2413// var isInvalid = this.validityChecks[i].isInvalid(input); 2414// if (isInvalid) { 2415// this.addInvalidity(this.validityChecks[i].invalidityMessage); 2416// } 2417 2418// var requirementElement = this.validityChecks[i].element; 2419 2420// if (requirementElement) { 2421// if (isInvalid) { 2422// requirementElement.classList.add('invalid'); 2423// requirementElement.classList.remove('valid'); 2424// } else { 2425// requirementElement.classList.remove('invalid'); 2426// requirementElement.classList.add('valid'); 2427// } 2428 2429// } // end if requirementElement 2430// } // end for 2431// }, 2432// checkInput: function () { // checkInput now encapsulated 2433 2434// this.inputNode.CustomValidation.invalidities = []; 2435// this.checkValidity(this.inputNode); 2436 2437// if (this.inputNode.CustomValidation.invalidities.length === 0 && this.inputNode.value !== '') { 2438// this.inputNode.setCustomValidity(''); 2439// } else { 2440// var message = this.inputNode.CustomValidation.getInvalidities(); 2441// this.inputNode.setCustomValidity(message); 2442// } 2443// }, 2444// registerListener: function () { //register the listener here 2445 2446// var CustomValidation = this; 2447 2448// this.inputNode.addEventListener('keyup', function () { 2449// CustomValidation.checkInput(); 2450// }); 2451 2452 2453// } 2454 2455//}; 2456 2457 2458 2459///* ---------------------------- 2460 2461// Validity Checks 2462 2463// The arrays of validity checks for each input 2464// Comprised of three things 2465// 1. isInvalid() - the function to determine if the input fulfills a particular requirement 2466// 2. invalidityMessage - the error message to display if the field is invalid 2467// 3. element - The element that states the requirement 2468 2469//---------------------------- */ 2470 2471//var usernameValidityChecks = [ 2472// { 2473// isInvalid: function (input) { 2474// return input.value.length < 3; 2475// }, 2476// invalidityMessage: 'This input needs to be at least 3 characters', 2477// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(1)') 2478// }, 2479// { 2480// isInvalid: function (input) { 2481// var illegalCharacters = input.value.match(/[^a-zA-Z0-9]/g); 2482// return illegalCharacters ? true : false; 2483// }, 2484// invalidityMessage: 'Only letters and numbers are allowed', 2485// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(2)') 2486// } 2487//]; 2488 2489//var passwordValidityChecks = [ 2490// { 2491// isInvalid: function (input) { 2492// return input.value.length < 8 | input.value.length > 100; 2493// }, 2494// invalidityMessage: 'This input needs to be between 8 and 100 characters', 2495// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(1)') 2496// }, 2497// { 2498// isInvalid: function (input) { 2499// return !input.value.match(/[0-9]/g); 2500// }, 2501// invalidityMessage: 'At least 1 number is required', 2502// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(2)') 2503// }, 2504// { 2505// isInvalid: function (input) { 2506// return !input.value.match(/[a-z]/g); 2507// }, 2508// invalidityMessage: 'At least 1 lowercase letter is required', 2509// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(3)') 2510// }, 2511// { 2512// isInvalid: function (input) { 2513// return !input.value.match(/[A-Z]/g); 2514// }, 2515// invalidityMessage: 'At least 1 uppercase letter is required', 2516// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(4)') 2517// }, 2518// { 2519// isInvalid: function (input) { 2520// return !input.value.match(/[\!\@\#\$\%\^\&\*]/g); 2521// }, 2522// invalidityMessage: 'You need one of the required special characters', 2523// element: document.querySelector('label[for="txtSignupPassword"] .input-requirements li:nth-child(5)') 2524// } 2525//]; 2526 2527//var passwordRepeatValidityChecks = [ 2528// { 2529// isInvalid: function () { 2530// return passwordRepeatInput.value != passwordInput.value; 2531// }, 2532// invalidityMessage: 'This password needs to match the first one' 2533// } 2534//]; 2535 2536 2537///* ---------------------------- 2538 2539// Setup CustomValidation 2540 2541// Setup the CustomValidation prototype for each input 2542// Also sets which array of validity checks to use for that input 2543 2544//---------------------------- */ 2545 2546////var usernameInput = document.getElementById('username'); 2547//var passwordInput = document.getElementById('txtSignupPassword'); 2548////var passwordRepeatInput = document.getElementById('password_repeat'); 2549 2550////usernameInput.CustomValidation = new CustomValidation(usernameInput); 2551////usernameInput.CustomValidation.validityChecks = usernameValidityChecks; 2552 2553//passwordInput.CustomValidation = new CustomValidation(passwordInput); 2554//passwordInput.CustomValidation.validityChecks = passwordValidityChecks; 2555 2556////passwordRepeatInput.CustomValidation = new CustomValidation(passwordRepeatInput); 2557////passwordRepeatInput.CustomValidation.validityChecks = passwordRepeatValidityChecks; 2558 2559 2560 2561 2562///* ---------------------------- 2563 2564// Event Listeners 2565 2566//---------------------------- */ 2567 2568//var inputs = document.querySelectorAll('input:not([type="submit"])'); 2569 2570 2571//var submit = document.querySelector('input[type="submit"'); 2572//var form = document.getElementById('registration'); 2573 2574//function validate() { 2575// for (var i = 0; i < inputs.length; i++) { 2576// inputs[i].CustomValidation.checkInput(); 2577// } 2578//} 2579 2580//submit.addEventListener('click', validate); 2581//form.addEventListener('submit', validate); 2582 2583 2584 2585///* ---------------------------- 2586 2587// CustomValidation prototype 2588 2589// - Keeps track of the list of invalidity messages for this input 2590// - Keeps track of what validity checks need to be performed for this input 2591// - Performs the validity checks and sends feedback to the front end 2592 2593//---------------------------- */ 2594 2595//function CustomValidation(input) { 2596// this.invalidities = []; 2597// this.validityChecks = []; 2598 2599// //add reference to the input node
2600// this.inputNode = input; 2601 2602// //trigger method to attach the listener 2603// this.registerListener(); 2604//} 2605 2606//CustomValidation.prototype = { 2607// addInvalidity: function (message) { 2608// this.invalidities.push(message); 2609// }, 2610// getInvalidities: function () { 2611// return this.invalidities.join('. \n'); 2612// }, 2613// checkValidity: function (input) { 2614// for (var i = 0; i < this.validityChecks.length; i++) { 2615 2616// var isInvalid = this.validityChecks[i].isInvalid(input); 2617// if (isInvalid) { 2618// this.addInvalidity(this.validityChecks[i].invalidityMessage); 2619// } 2620 2621// var requirementElement = this.validityChecks[i].element; 2622 2623// if (requirementElement) { 2624// if (isInvalid) { 2625// requirementElement.classList.add('invalid'); 2626// requirementElement.classList.remove('valid'); 2627// } else { 2628// requirementElement.classList.remove('invalid'); 2629// requirementElement.classList.add('valid'); 2630// } 2631 2632// } // end if requirementElement 2633// } // end for 2634// }, 2635// checkInput: function () { // checkInput now encapsulated 2636 2637// this.inputNode.CustomValidation.invalidities = []; 2638// this.checkValidity(this.inputNode); 2639 2640// if (this.inputNode.CustomValidation.invalidities.length === 0 && this.inputNode.value !== '') { 2641// this.inputNode.setCustomValidity(''); 2642// } else { 2643// var message = this.inputNode.CustomValidation.getInvalidities(); 2644// this.inputNode.setCustomValidity(message); 2645// } 2646// }, 2647// registerListener: function () { //register the listener here 2648 2649// var CustomValidation = this; 2650 2651// this.inputNode.addEventListener('keyup', function () { 2652// CustomValidation.checkInput(); 2653// }); 2654 2655 2656// } 2657 2658//}; 2659 2660 2661 2662///* ---------------------------- 2663 2664// Validity Checks 2665 2666// The arrays of validity checks for each input 2667// Comprised of three things 2668// 1. isInvalid() - the function to determine if the input fulfills a particular requirement 2669// 2. invalidityMessage - the error message to display if the field is invalid 2670// 3. element - The element that states the requirement 2671 2672//---------------------------- */ 2673 2674//var usernameValidityChecks = [ 2675// { 2676// isInvalid: function (input) { 2677// return input.value.length < 3; 2678// }, 2679// invalidityMessage: 'This input needs to be at least 3 characters', 2680// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(1)') 2681// }, 2682// { 2683// isInvalid: function (input) { 2684// var illegalCharacters = input.value.match(/[^a-zA-Z0-9]/g); 2685// return illegalCharacters ? true : false; 2686// }, 2687// invalidityMessage: 'Only letters and numbers are allowed', 2688// element: document.querySelector('label[for="username"] .input-requirements li:nth-child(2)') 2689// } 2690//]; 2691 2692//var passwordValidityChecks = [ 2693// { 2694// isInvalid: function (input) { 2695// return input.value.length < 8 | input.value.length > 100; 2696// }, 2697// invalidityMessage: 'This input needs to be between 8 and 100 characters', 2698// element: document.querySelector('label[for="txtforgotmobilePassword"] .input-requirements li:nth-child(1)') 2699// }, 2700// { 2701// isInvalid: function (input) { 2702// return !input.value.match(/[0-9]/g); 2703// }, 2704// invalidityMessage: 'At least 1 number is required', 2705// element: document.querySelector('label[for="txtforgotmobilePassword"] .input-requirements li:nth-child(2)') 2706// }, 2707// { 2708// isInvalid: function (input) { 2709// return !input.value.match(/[a-z]/g); 2710// }, 2711// invalidityMessage: 'At least 1 lowercase letter is required', 2712// element: document.querySelector('label[for="txtforgotmobilePassword"] .input-requirements li:nth-child(3)') 2713// }, 2714// { 2715// isInvalid: function (input) { 2716// return !input.value.match(/[A-Z]/g); 2717// }, 2718// invalidityMessage: 'At least 1 uppercase letter is required', 2719// element: document.querySelector('label[for="txtforgotmobilePassword"] .input-requirements li:nth-child(4)') 2720// }, 2721// { 2722// isInvalid: function (input) { 2723// return !input.value.match(/[\!\@\#\$\%\^\&\*]/g); 2724// }, 2725// invalidityMessage: 'You need one of the required special characters', 2726// element: document.querySelector('label[for="txtforgotmobilePassword"] .input-requirements li:nth-child(5)') 2727// } 2728//]; 2729 2730//var passwordRepeatValidityChecks = [ 2731// { 2732// isInvalid: function () { 2733// return passwordRepeatInput.value != passwordInput.value; 2734// }, 2735// invalidityMessage: 'This password needs to match the first one' 2736// } 2737//]; 2738 2739 2740///* ---------------------------- 2741 2742// Setup CustomValidation 2743 2744// Setup the CustomValidation prototype for each input 2745// Also sets which array of validity checks to use for that input 2746 2747//---------------------------- */ 2748 2749////var usernameInput = document.getElementById('username'); 2750//var passwordInput = document.getElementById('txtforgotmobilePassword'); 2751////var passwordRepeatInput = document.getElementById('password_repeat'); 2752 2753////usernameInput.CustomValidation = new CustomValidation(usernameInput); 2754////usernameInput.CustomValidation.validityChecks = usernameValidityChecks; 2755 2756//passwordInput.CustomValidation = new CustomValidation(passwordInput); 2757//passwordInput.CustomValidation.validityChecks = passwordValidityChecks; 2758 2759////passwordRepeatInput.CustomValidation = new CustomValidation(passwordRepeatInput); 2760////passwordRepeatInput.CustomValidation.validityChecks = passwordRepeatValidityChecks; 2761 2762 2763 2764 2765///* ---------------------------- 2766 2767// Event Listeners 2768 2769//---------------------------- */ 2770 2771//var inputs = document.querySelectorAll('input:not([type="submit"])'); 2772 2773 2774//var submit = document.querySelector('input[type="submit"'); 2775//var form = document.getElementById('registration2'); 2776 2777//function validate() { 2778// for (var i = 0; i < inputs.length; i++) { 2779// inputs[i].CustomValidation.checkInput(); 2780// } 2781//} 2782 2783//submit.addEventListener('click', validate); 2784//form.addEventListener('submit', validate); 2785 2786
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.