Rabu, 12 Maret 2014

Numeric

Yanng Posting Unknown di 03.17
<hmtl>
<head>
<title>Validasi Numerik</title> 
</head>
    
  <script> 
  function cekNumeric() 
  
     var cek = document.getElementById("numeric").value;
  
     if (!/^[0-9]+$/.test(cek)) 
     
        alert("INPUT DATA HARUS NUMERIC !!!"); 
        document.getElementById("numeric").value="";
     }
     else
     {
   alert ("INPUT DATA NUMERIC: "+cek);
}
  
  </script>      
     <input id="numeric" type="text"
     <input type="Button" onclick="cekNumeric()" value="cek"

</html>

0 komentar:

Posting Komentar

 

SI MATA SEMUT Template by Ipietoon Blogger Template | Gift Idea