It is basically done with the help of JavaScript. Code Snippet written below for name field in a form.

Example

                                        

function validate() {
  var x = document.forms["Form"]["name"].value;
  if (x == "") {
    alert("Name must be filled out");
    return false;
  }
}

Suggest An Answer

No suggestions avaliable!