One of the most helpful HTML5 atrributes for form validation is the required attribute. …On browsers that support it, it will prevent the form from being submitted …unless the input is filled out. I'll be using this form from our exercise files. …This is one of the forms I styled in my course on CSS styling forms. …If we take a look at the code for this page, you can see a single input field. …I'm going to add the required attribute to the input field and then switch over …to the browser. I'll refresh the form. …And if I try to submit it without filling it out, I'll get a little error message …that says please fill out this field. It also won't let me submit the form.…
When you use the required attribute, it's always a good idea to also use the …placeholders attribute. Placeholders give users a hint as to how …they're supposed to fill out our field. That way, the user will know that I don't …simply want their first name. Let me refresh this page. …And you can see that it appears as a grayed out item. …
- 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.