HTML5 input fields have a super cool attribute called Pattern, which you can …use inside fields to check the user's input against a specific set of characters. …Inside this attribute, you define a string that prevents the form from …submitting unless the text in the input field matches the pattern. …The language we use to format our string is called a regular expression. …And they're common to a variety of programming languages. …Let's take a look at how this works. I have a very simple form here with a …single field that expects you to type in a correct pattern.…
So let's go to the code for this. And I'm going to add the Pattern …attribute to this field. Now I'm going to add some literal text here. …Texas and save this. Go back into my form, make sure I …refresh, and I'm going to try to type something into the form. …I'll try California. And when I hit Enter, I get a popup that …says to please match the requested format. …So I'm going to try typing Texas now and hit Enter. …You see that I still get please match the requested format because when I typed it …
- Understanding forms
- Adding required fields and placeholders
- Accepting multiple entries
- Limiting uploads
- Handling focus changes
- Validating with regular expressions
- Working with older browsers
- Building jQuery validation
- Using server-side validation
- Sanitizing form input
- Uploading files
- Sending form data to a database
Skill Level Intermediate
1. Getting Started
2. Validating with HTML5
4. jQuery Form Validation
Understanding jQuery3m 47s
5. Working with PHP
6. Processing Form Data
Next steps1m 17s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.