Validate HTML Forms with JavaScript and HTML

提供方
Coursera Project Network
在此指導項目中,您將:

Explain the importance of verifying the data values entered on a form.

Write JavaScript code that validates values entered on an HTML form.

Demonstrate techniques for validating values entered on a form using HTML built-in validation.

Clock2 hours
Intermediate中級
Cloud無需下載
Video分屏視頻
Comment Dots英語(English)
Laptop僅限桌面

By the end of this project, you will have written and tested JavaScript and HTML code that validates data values entered into input fields on an HTML form. Data validation is a valuable skill in web development. Notifying users of input errors not only improves the user experience it also helps to ensure that any data collected via a form is as accurate as possible before sending it to a server for processing. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

您要培養的技能

  • Client-side Form Validation
  • HTML5 Built-in Form Validation
  • Javascript Methods
  • Data Validation
  • JavaScript

分步進行學習

在與您的工作區一起在分屏中播放的視頻中,您的授課教師將指導您完成每個步驟:

  1. Compare client- and server-side validation as you investigate when and where to validate data values to reduce data input errors.

  2. Use JavaScript code to check an input field on a form to ensure that it has been filled in and display an error message if the field is empty.

  3. Use JavaScript to test the value entered into a form field to determine its length and/or whether it falls within a range of numeric values and display an error message if that is not the case.

  4. Test the value entered into a form to ensure that it matches an email address format and display an error message if it does not.

  5. Modify HTML code to include built in form validation to check for a range of numbers, a list of values and the correct format for an email address.

指導項目工作原理

您的工作空間就是瀏覽器中的雲桌面,無需下載

在分屏視頻中,您的授課教師會為您提供分步指導

常見問題

常見問題

還有其他問題嗎?請訪問 學生幫助中心