Hi everyone -
I’m tasked to build validation for an HTML form using JavaScript. I’ve never actually done JavaScript form validation so this is a pretty new area for me and the tutorials I’ve found have been a bit helpful but I haven’t found scenarios for these types of validation:
- Make sure the first name and last name fields aren’t empty. Before sending the names to the server, process them so that they would have the first capital letter and all the remaining letters are small.
- Check that the State field contains two capital letters.
- Make sure ZIP code field is positive number.
- Check that a value is selected in a list of check boxes.
- Check for a valid date in the date field.
- Check that something is selected in the radio button selection.
Sorry for all of the unique scenarios, going crazy trying to figure these out. If any one can recommend how to go about creating the above validations or useful spots to check I’d appreciate it.
(The university is teaching extremely dates and poor habits for JavaScript validation I’ve been told so I’m hoping to get a better understanding…)
Thanks guys