<script> function verifynotify(field1, field2, result_id, match_html, nomatch_html) { this.field1 = field1; this.field2 = field2; this.result_id = result_id; this.match_html = match_html; this.nomatch_html = nomatch_html;
this.check = function() { if (!this.result_id) { return false; } if (!document.getElementById){ return false; } r = document.getElementById(this.result_id); if (!r){ return false; }
if (this.field1.value != "" && this.field1.value == this.field2.value) { r.innerHTML = this.match_html; } else { r.innerHTML = this.nomatch_html; } } }
function verifyInput() { verify = new verifynotify(); verify.field1 = document.password_form.password1; verify.field2 = document.password_form.password2; verify.result_id = "password_result"; verify.match_html = "<span style=\"color:blue\">Æнº¿öµå°¡ È®ÀεǾú½À´Ï´Ù.<\/span>"; verify.nomatch_html = "<span style=\"color:red\">Æнº¿öµå¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇϼ¼¿ä.<\/span>";
// Update the result message verify.check(); }
function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } }
addLoadEvent(function() { verifyInput(); }); </script> </head> <body>
<form name="password_form"> Æнº¿öµåÀÔ·Â : <input type="password" name="password1" onkeyup="verify.check()"><br> Æнº¿öµåÈ®ÀÎ : <input type="password" name="password2" onkeyup="verify.check()"></br> <p> <div id="password_result"> </div> </form>
</body> </html>
|