I am a beginner and I have written a code for validating the form as:
function validateForm(){ var x=document.forms[\"myForm\"][\"fname\"].value; if (x==null ||
This is the exact solution to my problem. Where the user gets some kind of notification when the object losses focus:
The HTML form is:
First name:
The div can be designed in CSS to red color to get user attention and many more tricks can be played.