Comparing password values in two fields to match

highrockmedia 30 Sep, 2008
I have searched the forums and found a few threads on this but it looks like there are still no clear answers or solutions and it's still very confusing .

I need to compare two password fields to make sure they match each other.

Has it been determined what is the best way to do this. I am using Chronoforms in place of Joomla registration and have it all working except for this.

I have found these threads which make no sense to me as there are so many variations of the code people are trying to use:

http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=10407&p=10488&hilit=compare+value
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=10863&p=12141&hilit=password

Thank you.
highrockmedia 01 Oct, 2008
When you say the JS hack do you mean the mootools file alteration? I cannot tell by looking at the forum what has worked and what has not for people so it's like trying to get a needle from a haystack as there are several posts with slightly different versions of the same code.

I tried the PHP code you posted but got an error:

Fatal error: Class 'JRequest' not found in /home/unidesk/public_html/components/com_chronocontact/chronocontact.php(401) : eval()'d code on line 3


I am putting the code where it says:

On Submit code - before sending email:
(may contain valid PHP code in PHP tags


I should add that I am using Joomla 1.0.15 so I am not sure this method will work.
Max_admin 01 Oct, 2008
I see, the PHP code is for Chronoforms J1.5 V3.0, your only hope now is the JS one at the first link, please follow posts from this one :
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=10407&st=0&sk=t&sd=a&hilit=compare+value#p10410

tell the user confirms it works!

let me know!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 01 Oct, 2008
or why don't you omit Chronoforms validation and use a simple JS alert box and it will work perfectly and easier to do ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
highrockmedia 01 Oct, 2008

or why don't you omit Chronoforms validation and use a simple JS alert box and it will work perfectly and easier to do ?


yes I could just like the default joomla does but it kind of would be nice to use mootools. Maybe you could build field comparing in to the next version of CForms.
highrockmedia 01 Oct, 2008
I got this to work, crude but functional:

function checkForm(form)
{

if(form.password.value != form.password2.value)  {
alert("Your passwords must match in both fields");
     return false;
  }

else
 return true;

}


and then putting this in form tag attachment:

onSubmit="return checkForm(this)"
Max_admin 01 Oct, 2008
Great, at the next version I will try to add this but I'm planning to add a plain alert box validation too because at some cases the current one breaks the layout or moves fields.

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.