Verifikasi field password on change field

<html>
    <head>
        <title>Validasi</title>
    </head>
    <body>
 
   

     <script src="jQuery.min.js"></script>
<script>
function cekPass()
{
p1 = document.frm.pass1.value;
p2 = document.frm.pass2.value;
if(p1==p2)
{
document.frm.btn.disabled=false;
document.frm.nama.disabled=false;
document.frm.alamat.disabled=false;
document.frm.tanggal.disabled=false;
}
else
{
alert('Password Tidak Sama');
}
}
</script>
<fieldset>
<legend>Pendaftaran Member</legend>
<form name="frm" method="post">
<table>
<tr><td>Password </td><td>: <input type="password" name="pass1" onChange="cekPass();"></td></tr>
<tr><td>Ulangi Password </td><td>: <input type="password" name="pass2" onChange="cekPass();"></td></tr>
<tr><td>Nama </td><td>: <input type="text" name="nama" disabled="true"></td></tr>
<tr><td>Alamat </td><td>: <input type="text" name="alamat" disabled="true"></td></tr>
<tr><td>Tanggal </td><td>: <input type="text" name="tanggal" disabled="true"></td></tr>
<tr><td colspan=2><input type="submit" name="btn" disabled="true" value="Kirim Inputan"></td></tr>
</form>
</fieldset>
    </body>
</html>

Tidak ada komentar:

Posting Komentar