Last Updated : Jan 1, 2023
In last tutorial, we already done the article of validation of empty field.
So, in this tutorial we are going to apply validation on data that user fills inside input type.
- In previous tutorials, we already many times create a full code example in which we first create an html form with its basic structure. Inside that structure we use html, head, and title, body and script tags.
- In this example, we have to create a form with method type post and action of any page in which you want user to redirect.
- Inside that form, we have to create input fields. First one is of type text and second is of type submit. Inside input type text, user have to fill his/her first name and then have to click on submit button to check whether the name given by user is valid or not.
- At next, let us understand our function now. Here, in this function we create a variable first and feed the data which we want in our first name.
- If you want to see how we done this. You can see the above example for better understanding. We hope with these steps you understand the above example easily.