Validasi form sederhana dengan javascript dan HTML (Form Validation) - Pemrograman Web Dinamis
index.php <!DOCTYPE html> <html> <head> <title>POSTEST 7</title> </head> <body> <script type="text/javascript"> function isiuser(){ var user = document.getElementById('user').value; if ((user.length < 5) || (user.length > 20)) { document.getElementById('tag-user').innerHTML= 'User harus 5 - 20 karakter'; } else{ document.getElementById('tag-user').innerHTML= ''; } } function isipass(){ var user = document.getElementById('user').value; var pass = document.getElementById('pass').value; if (pass == user) { document.getElementById('tag-pass').innerHTML= 'Password tidak boleh sama dengan Username'; } else if ((pass.length < 5) && (pass.length > 20)) { document.getElementById('tag-pass').innerHTML= 'Password harus 5 - 20 karakter'; } else{