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 language="javascript">
2
3function checkEmail() {
4
5 var email = document.getElementById('txtEmail');
6 var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
7
8 if (!filter.test(email.value)) {
9 alert('Please provide a valid email address');
10 email.focus;
11 return false;
12 }
13}</script>
1function ValidateEmail(inputText)
2{
3var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
4if(inputText.value.match(mailformat))
5{
6document.form1.text1.focus();
7return true;
8}
9else
10{
11alert("You have entered an invalid email address!");
12document.form1.text1.focus();
13return false;
14}
15}
16
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}