diff --git a/src/main/resources/static/js/emailValidation.js b/src/main/resources/static/js/emailValidation.js deleted file mode 100644 index e3532bd9de978c57c72e6c427c7c1f60cab5dcae..0000000000000000000000000000000000000000 --- a/src/main/resources/static/js/emailValidation.js +++ /dev/null @@ -1,69 +0,0 @@ -$(document).ready(function () { - const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; // ç®€å• Email æ£åˆ™ - //Listen for input events using jQuery's on method - - $('#email').on('input', function () { - const emailValue = $(this).val(); - const $emailError = $('#emailError'); - - // Check whether the input is empty or does not match the regular expression - if (!emailPattern.test(emailValue) && emailValue !== '') { - $emailError.text("Please enter a valid email address."); - $emailError.show(); // Display error message - } else { - $emailError.text(""); - $emailError.hide(); // Hide error message - } - }); - - $('#name').on('mouseleave', function () { - const value = $(this).val(); - const $nameError = $('#nameError'); - - if (value == '') { - $nameError.text("Please enter data."); - $nameError.show(); - } else { - $nameError.text(""); - $nameError.hide(); - } - }); - - $('#password').on('mouseleave', function () { - const value = $(this).val(); - const $passwordError= $('#passwordError'); - - if (value == '') { - $passwordError.text("Please enter data."); - $passwordError.show(); - } else { - $passwordError.text(""); - $passwordError.hide(); - } - }); - - $('#phone').on('mouseleave', function () { - const value = $(this).val(); - const $phoneError= $('#phoneError'); - // 检查输入是å¦ä¸ºç©ºæˆ–ä¸ç¬¦åˆæ£åˆ™è¡¨è¾¾å¼ - if (value == '') { - $phoneError.text("Please enter data."); - $phoneError.show(); - } else { - $phoneError.text(""); - $phoneError.hide(); - } - }); - $('#address').on('mouseleave', function () { - const value = $(this).val(); - const $addressError= $('#addressError'); - - if (value == '') { - $addressError.text("Please enter data."); - $addressError.show(); - } else { - $addressError.text(""); - $addressError.hide(); - } - }); -}); \ No newline at end of file