Hy,
With the following function you can check those conditions
If you are learning JavaScript, study the code and adapt it for youre use.Code:function SubmitForm(id) { var objid = document.getElementById(id).value; if( (objid==NULL || objid.length<3 || objid.indexOf("@")==-1 || objid.indexOf('.')==-1) { alert("please complete email address corectly"); return false; } else return true; }
You need to create more if() conditions in that function, one separately for mail field.