1 /* Event for login button submit */ 2 $('#kt_login_signin_submit').on('click', function (e) { 3 var validation = validateForm(); 4 if (!validation.valid()) { 5 return; 6 } 7 if (validation) { 8 form.submit(); 9 } else { 10 swal.fire({ 11 text: "Sorry, looks like there are some errors detected, please try again.", 12 icon: "error", 13 buttonsStyling: false, 14 confirmButtonText: "Ok, got it!", 15 customClass: { 16 confirmButton: "btn font-weight-bold btn-light-primary" 17 } 18 }).then(function() { 19 KTUtil.scrollTop(); 20 }); 21 } 22 }); 23 24 /* Function for validate form */ 25 function validateForm() { 26 form = $("#kt_login_signin_form"); 27 form.validate({ 28 rules: { 29 email: { 30 required: true, 31 minlength: 6, 32 maxlength: 12, 33 number:true 34 }, 35 password: { 36 required: true, 37 }, 38 }, 39 messages: { 40 email:{ 41 required : "Enter mobile number", 42 number:"Please enter mobile number" 43 }, 44 password: { 45 required:"Please enter your password", 46 } 47 }, 48 errorPlacement: function(label, element) { 49 label.addClass("arrow") 50 label.insertAfter(element); 51 }, 52 }); 53 return form; 54 } 55 56 $(function () { 57 $("#toggle_pwd").click(function () { 58 $(this).toggleClass("fa-eye fa-eye-slash"); 59 var type = $(this).hasClass("fa-eye") ? "text" : "password"; 60 $("#password").attr("type", type); 61 }); 62 }); 63 64 $(document).on('keydown','#kt_login_signin_form',function (e) { 65 if (e.keyCode == 13) { 66 $('#kt_login_signin_submit').click(); 67 } 68 }); 69 70
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.