Simple validation in javascript.

Hello Friends,

This is one of the simple code example for validation in javascript. By using the following code, we can make certain input field as a mandatory i.e. one cannot proceed until and unless there is certain value in the required field. In this example we use the simple login screen where we are making the field Username as mandatory. Following is the code.

Similarly you can use this validation code to validate any kind of form or page, you just have to call the function on the onclick event of submit button.

Hope this helps you.

Thanks !

One thought on “Simple validation in javascript.”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.