Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now, it says please enter an email address. If I put two characters or so in the email address, it says, please enter a valid email address. Now, this piece is not specifically testing and being real picky about the e-mail address. As I said, this is a topic that we could talk about for a long time, this is very simple. It's testing the number of characters in the email address, so I'll put in a correct email address. Let's put example in here.
Now, the first thing that's going to happen, is this is our form this is the name field on the form. In other words, that text box called name, where the user would put in their name. This is what represents whatever the user typed in to that box. And we're going to test the length of whatever the user put into that box. If its less than 1 meaning if it's 0, they didn't enter anything in that box. We're going to get a message that says please enter your name.
Once that box pops up and the user clicks Okay, it's going to put the users cursor back in that name field and let our form know do not submit, return false, don't submit the form. This next one is simply testing to see if there's an empty inside that same value area. So these are almost double checking one another, please enter your name. Focus goes back in the name field. Now, we have a similar thing going on that we just looked at with the email. So, it's going to test and see if it's empty.
If so, we're going to get a, please enter an email address. This is going to test for how many characters are in the box. And this is the one where we got, please enter a valid email address, because I put less than 5 characters into the form field for email. So, this is the email address and that's all we have set up on our form. The comments area is not going to be required. If we wanted it to be required, we could use these same if statements.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98529 Viewers
61 Video lessons · 85819 Viewers
71 Video lessons · 69720 Viewers
56 Video lessons · 102030 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.