Provide an external JavaScript code that will validate all the fields of the attached form using the following criteria: a) Name field must not be empty. b) Phone number must accept the regular expression pattern: "[0-9]{3}-[0-9]{3}-[0-9]{4}" c) Email address must not be empty and must be tested against the regular expression: /^\S+@\S+\.\S+$/ d) The Gender field field must not be empty. Use the following in the list: 1. Select an option 2. Female 3. Male 4. Prefer not to say e) The amount field must not be empty. It must only accept numeric entries between 1 and 1000 f) The Fund field must not be empty. Use the following in the list: 1. Select an option 2. Building 3. Accommodation 4. Food g) If validation passes, display an alert that captures all what the user has entered in the form(see attached figure 2)
Provide an external JavaScript code that will validate all the fields of the attached form using the following criteria:
a) Name field must not be empty.
b) Phone number must accept the regular expression pattern: "[0-9]{3}-[0-9]{3}-[0-9]{4}"
c) Email address must not be empty and must be tested against the regular
expression: /^\S+@\S+\.\S+$/
d) The Gender field field must not be empty. Use the following in the list:
1. Select an option
2. Female
3. Male
4. Prefer not to say
e) The amount field must not be empty. It must only accept numeric entries
between 1 and 1000
f) The Fund field must not be empty. Use the following in the list:
1. Select an option
2. Building
3. Accommodation
4. Food
g) If validation passes, display an alert that captures all what the user has entered in the form(see attached figure 2)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps