- [Voiceover] In this video, we're going to start looking…at some ways to make sure that some fields are filled in,…and making some changes accordingly.…In order to estimate this order total,…of course I'm going to need to know how many products…of each type the user wants to order.…But I also have this state field down here,…which is required.…Currently, when I click estimate total and submit the form,…I get no indication that I haven't filled this in.…So we're going to make some changes, so that the user…must fill this in before the total will be estimated.…
The first thing that we'll do is make sure…that the field is not empty.…Switching back to my script,…here in my estimate total function,…I can get rid of my console message,…and now I can look at the value of that state field…and react if it's empty.…How do we do that?…I'm going to use an if statement,…which looks like this.…If, parentheses,…and then curly braces indicating what I want to happen.…So here in the parentheses, I'm going to fill in…the condition that I want to check.…
- Working with the DOM
- Creating maps with the Google Maps API
Skill Level Beginner
2. Writing and Debugging
3. Working with Forms
4. A Matter of Time
5. Using the Google Maps API
- 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.