1function isValidEmail(email) {
2 const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
1<script>
2function validateform(){
3var name=document.myform.name.value;
4var password=document.myform.password.value;
5
6if (name==null || name==""){
7 alert("Name can't be blank");
8 return false;
9}else if(password.length<6){
10 alert("Password must be at least 6 characters long.");
11 return false;
12 }
13}