acctman Posted May 28, 2009 Share Posted May 28, 2009 I've been trying to get this code below to work but it seems to display the message box regardless if the passwords are the same or now. <input type=password id='pass' name=add[pass] size=20 /> <input type=password id='pass_confirm' name='pass_confirm' size=20 onblur="return checkPasswords()"/> <script language="javascript"> function checkPasswords() { passone = document.getElementById('pass'); passtwo = document.getElementById('pass_confirm'); if (passone.value != passtwo.value) { alert("Password & Confirm Password must match.") } } </script> Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 First of all, please use tags. What's add[pass]? <input type=password id='pass' name=add[pass] size=20 /> Quote Link to comment Share on other sites More sharing options...
acctman Posted May 28, 2009 Author Share Posted May 28, 2009 First of all, please use tags. What's add[pass]? <input type=password id='pass' name=add[pass] size=20 /> sorry about that, i thought i typed in the HTML /HTML ... add[pass] is for my php post script, its part of an array some fields are set with edit[city] it just helps separate the post entries Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.