<script language="JavaScript">
  function checkForm()
  {
    var valid = false;    valid = checkName();
    if (valid==false)
    {
      window.alert("Invalid name.");
      return false;
    }    valid = chekcIdentificationNumber()
    if (valid==false)
    {
      window.alert("Invalid identification number.");
      return false;
    }    // Do something like checking name and checking identification number.
    // ....    return true;
  }  function checkName()
  {
    var blacklist = "~!@#$%^&*()"; // All the invalid characters.
    var name = document.form.textName.value;
    for (int i = 0; i<name.length; i++)
      if (blacklist.indexOf(name.charAt(i))>=0)
        return false;
    return true;
  }  // Put the checkIdentificationNumber() and other functions here like checkName().
</script><form name="form" onSubmit="return checkForm();" >
  <input type="text" name="textName" />
  <inpit type="text" name="textIdentificationNumber" />
  <!-- Put the other input fields -->
</form>