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> Link to comment https://forums.phpfreaks.com/topic/160075-confirm-password/ 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 /> Link to comment https://forums.phpfreaks.com/topic/160075-confirm-password/#findComment-844544 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 Link to comment https://forums.phpfreaks.com/topic/160075-confirm-password/#findComment-844550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.