Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A local weather page, show _ weather.php , consists of a form with one input element and one submit button. Users can get the
A local weather page, "showweather.php consists of a form with one input element and one submit button.
Users can get the current weather for a location of their choice by entering the US ZIP code for the location this only works for US locations The regex for a valid US ZIP code is d:sd$
Your task is to implement JavaScriptbased form validation. You are required to use CSS for the DOM manipulation for this question.
The following is a list of the DOM elements that require validation to be performed.
The input element valid US ZIP code format
The form verify that the input element has a valid US ZIP code format before submitting
If the usersupplied ZIP code does not pass validation when the input element loses focus, show the input format help text.
If the usersupplied ZIP code is not does not pass validation when the user presses the button to submit the form, show the form submission error and prevent the form from submitting.
If the usersupplied ZIP code passes all validation, allow the form to be submitted.
Hint: ensure the help and error text are in the proper state, visible or not visible, at all times.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started