Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

validate email input javascript onchange

 <script type="text/javascript">
 function ShowAlert() {
  var email = document.getElementById('txtEmailId');
  var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
    if (!filter.test(email.value)) {
        alert('Please provide a valid email address');
        email.focus;
        return false;
    }
    else {
        alert("Thanks for your intrest in us, Now you 
        will be able to receive monthly updates from us.");
        document.getElementById('txtEmailId').value = "";
    }
 }
 </script> 
Comment

form validation for email in js

<script>  
function validateform(){  
var name=document.myform.name.value;  
var password=document.myform.password.value;  
  
if (name==null || name==""){  
  alert("Name can't be blank");  
  return false;  
}else if(password.length<6){  
  alert("Password must be at least 6 characters long.");  
  return false;  
  }  
}  
Comment

validate email input javascript onchange

   <input input type="text" name="txtEmailId" id="txtEmailId" /> 
   <input type="submit" class="button" value="Suscribe" name="Suscribe" 
            onclick="javascript:ShowAlert()" />
Comment

PREVIOUS NEXT
Code Example
Javascript :: react type div onClick 
Javascript :: datepicker auto close 
Javascript :: javascript reverse loop 
Javascript :: javascript string contains function 
Javascript :: format money javascript 
Javascript :: dropzone get response 
Javascript :: convert decimal to binary javascript 
Javascript :: js convert array of array to array 
Javascript :: owl.js cdn 
Javascript :: check if any property of object is null javascript 
Javascript :: how to preview a pdf document in react 
Javascript :: how to get last item in array javascript 
Javascript :: wait for ajax to finish 
Javascript :: how to get a record in dynamodb nodejs 
Javascript :: check if string contains at least one number javascript 
Javascript :: ngmodel angular 
Javascript :: js form check all required input 
Javascript :: chess 
Javascript :: js array loop backwards 
Javascript :: discord.js ban command 
Javascript :: lwc quick action close 
Javascript :: TypeError: sequelize.import is not a function 
Javascript :: calculus of finite differences calculator 
Javascript :: get data from url in angular 
Javascript :: deploy react js heroku 
Javascript :: deprecation warning: value provided is not in a recognized rfc2822 or iso format. moment construction falls back to js date(), which is not reliable across all browsers and versions 
Javascript :: node js get time in timezone 
Javascript :: set header as json in laravel 
Javascript :: javascript find all matches in array 
Javascript :: dangerouslySetInnerHTML 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =