“Validasi input email javascript onchange” Kode Jawaban

Validasi input email 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> 
Grieving Gharial

Validasi input email javascript onchange

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

Jawaban yang mirip dengan “Validasi input email javascript onchange”

Pertanyaan yang mirip dengan “Validasi input email javascript onchange”

Lebih banyak jawaban terkait untuk “Validasi input email javascript onchange” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya