Jump to content

Confirm password


acctman

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.