Changed around line 1
+ document.getElementById('signupForm').addEventListener('submit', function(event) {
+ event.preventDefault();
+
+ const name = document.getElementById('name').value.trim();
+ const phone = document.getElementById('phone').value.trim();
+ const email = document.getElementById('email').value.trim();
+
+ const phonePattern = /^\d{3}-\d{3}-\d{4}$/;
+ const emailPattern = /^[a-zA-Z0-9._%+-]+@(?!.*(qq\.com|163\.com|gmail\.com))[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
+
+ let message = '';
+
+ if (!name) {
+ message = 'Please enter your name.';
+ } else if (!phonePattern.test(phone)) {
+ message = 'Please enter a valid phone number (e.g., 123-456-7890).';
+ } else if (!emailPattern.test(email)) {
+ message = 'Please enter a valid company email address.';
+ } else {
+ message = 'Thank you for signing up! We will contact you soon.';
+ document.getElementById('signupForm').reset();
+ }
+
+ document.getElementById('message').textContent = message;
+ });