Making an input type for checking valid email address in HTML
As a web design services, we often use input type="text" and input type="password" like below:
For text: <input type="text" name="username" size="25" maxsize="15">
For password: <input type="password" name="password">
The syntax above can be used for all types of data including email address. But how can we check whether the email address is valid or not?
If we use the code like below:
Read: Checking Password Strength with pStrength jQuery Plugin
<input type="text" name="email" required>
we will face a trouble because the form can be submitted even with invalid email address. Off course we can use javascript or jquery to check the input value before being submitted or using PHP to check the submitted value. But we do not need to do that, because just HTML tag.
Read: Checking Password Strength with pStrength jQuery Plugin
The solution is chahing input type becomes input type="email".
The complete code is like below:
<input type="email" name="email" required>
By doing this, the error message will show up if the vallue is invalid email address, and the form cannot be submitted.
It is very easy for web design services, right?