ConsTrain numeric and date fields JavaScript and PHP Forms JavaScript Forms


show more Constraining numeric and date fields provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the Validating and Processing Forms with JavaScript and PHP show less
please wait ...

Constraining numeric and date fields

Some numeric fields have attributes that let you control the number of characters as well as the minimum and maximum value. These will even work with dates. So, I have a simple form here, where I'm asking the user a name, age, and when they would like to make a reservation. You can have the browser prevent the user from typing fields longer than a certain length. With a maxlength attribute that works for fields like text, email, search, password, telephone or url. We can for example make sure that their name is no longer than ten letters, perhaps our database limits the length of that field. We'll see how that works, we'll go into our code for this page and modify the name input field, so that it has a maxlength we'll make it ten characters. So I'll save this, I'll go back to my form, Refresh, and when I try to type in something longer than ten characters, the browser will stop me at ten characters. Some other attributes that you can use are min and...

Constraining numeric and date fields
Video duration: 2m 32s 2h 51m Intermediate

Viewers:

Constraining numeric and date fields provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the Validating and Processing Forms with JavaScript and PHP

Subjects:
Developer Web
Software:
JavaScript PHP
Author:
please wait ...