The document outlines validation tasks for a form, including requirements for first and last names, email format, age restrictions, and phone number specifications using JavaScript and Regex. Error messages are to be displayed based on specific validation failures, and inputs should be hidden upon focus. If all inputs are valid, the form should be hidden and the data displayed as text.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views2 pages
TaskDay3
The document outlines validation tasks for a form, including requirements for first and last names, email format, age restrictions, and phone number specifications using JavaScript and Regex. Error messages are to be displayed based on specific validation failures, and inputs should be hidden upon focus. If all inputs are valid, the form should be hidden and the data displayed as text.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Task Day 3:
In the form we did in Day 2:
1- a.Firstname and Lastname should at least have 3 letters b. no special characters or numbers (use Regex) . return error message when (focus out) based on which case happen (in red color) a Please enter 3 letters at least. b Please add characters only.
2- Use Regex for email.
Please enter a right email.
3- If age <18. Display message You should be more than 18.
4- Create Element for phone number using JS.
The phone number length should be 11 number It should takes only number and should start with (010) Other than that display message (Please enter valid mobile number).
5- For all the messages above should be hidden when the user focus again in the input.
6- If there is an error. We can’t submit and we should display
alert (‘Please check your inputs’)
C2 General If all inputs right => hide the form and display data as a text