Let us learn to make your own website using the programming language php, java, html, css etc.

Membatasi Minimal Inputan

by dekurnia , at 6:08 AM , have 0 comments
  • Membatasi Minimal Inputan

    Gunakan form username diatas sebagai contoh, dan ganti JavaScriptnya menjadi berikut
    <script type="text/javascript">
    function validasi_input(form){
      var mincar = 5;
      if (form.username.value.length < mincar){
        alert("Panjang Username Minimal 5 Karater!");
        form.username.focus();
        return (false);
      }
       return (true);
    }
    </script>
     
    Jadi ketika isi dari form username panjangnya kurang dari 5, maka akan muncul alert “Panjang Username Minimal 5 Karakter”

    lanjut.....!
dekurnia
Membatasi Minimal Inputan - written by dekurnia , published at 6:08 AM, categorized as Java Script . And have 0 comments
No comment Add a comment
Cancel Reply
GetID
Theme designed by Damzaky - Published by Proyek-Template
Powered by Blogger