Hi,
Can i validate two fields with V4, for example email and email confirmation?
Thanks
Can i validate two fields with V4, for example email and email confirmation?
Thanks
Hi Lapo,
Hmmm . . . Max hasn't included that in the Wizard but the library that he is using is FormCheck and that includes the Confirm check that does what you need. I guess that it must be possible to add this in the Form HTML but I'm not sure if you can add it through the Wizard.
Bob
Hmmm . . . Max hasn't included that in the Wizard but the library that he is using is FormCheck and that includes the Confirm check that does what you need. I guess that it must be possible to add this in the Form HTML but I'm not sure if you can add it through the Wizard.
Bob
Hi,
This can be done by adding a class to your element:
and adding a JS snippet using a load JS action:
Where "confirm_email" is an id for the email confirmation field.
Regards,
Max
This can be done by adding a class to your element:
validate['%checkEqual']
and adding a JS snippet using a load JS action:
function checkEqual(el){
if (el.value != $('confirm_email').value) {
el.errors.push("Emails are not the same!");
return false;
} else {
return true;
}
}
Where "confirm_email" is an id for the email confirmation field.
Regards,
Max
Works great till I hit the submit button. I'm checking the password fields and have assigned the "Enter Password" field a Field Class of validate['%checkEqual'] and then the "Verify Password" field a Field ID of confirm_password. I entered the JS code in the "Load JS" action as the last On Load event and this is what Firebug shows me for my <head> section:
[attachment=0]JS-Firebug.JPG[/attachment]
When I enter an incorrect password for VERIFY the JS works great.
However when correcting the mistake or entering the correct passwords the first time and on clicking the Submit button there is no error message and the page reloads itself with all the entered data still in place. The page scrolls down where I have a duplicate menu of the top, I'm assuming it's scrolling down to the Register menu item?
What have I missed?
[attachment=0]JS-Firebug.JPG[/attachment]
When I enter an incorrect password for VERIFY the JS works great.
However when correcting the mistake or entering the correct passwords the first time and on clicking the Submit button there is no error message and the page reloads itself with all the entered data still in place. The page scrolls down where I have a duplicate menu of the top, I'm assuming it's scrolling down to the Register menu item?
What have I missed?
Okay I changed the order of things a bit. I re-assigned the "Enter Password" field a Field ID of confirm_password and then the "Verify Password" field a Field Class of validate['%checkEqual']. So you enter a password and and enter the WRONG verification, as soon as you click anything else you get the JS generated error message.
However I still have the same problem of the page not re-directing? just reloading itself.
However I still have the same problem of the page not re-directing? just reloading itself.
Hi,
This solution is only to show a "JS popup" error message when the 2 fields values are not the same, does this work ? if its working then this solution works ok and the other problem you have is something different which we can discuss in a different thread🙂
Let us know!
Regards,
Max
This solution is only to show a "JS popup" error message when the 2 fields values are not the same, does this work ? if its working then this solution works ok and the other problem you have is something different which we can discuss in a different thread🙂
Let us know!
Regards,
Max
I just tested Max's solution and it does work.
Just so it's clear, in the first email field I put a Field Class of "validate['%checkEqual']" and then in the second email field I put a Field ID of "confirm_password". I entered the JS code Max provided above in a Load JS action as the last On Load event.
Thank you Max!
Dan
Just so it's clear, in the first email field I put a Field Class of "validate['%checkEqual']" and then in the second email field I put a Field ID of "confirm_password". I entered the JS code Max provided above in a Load JS action as the last On Load event.
Thank you Max!
Dan
Thanks for confirming it works!!🙂
Regards,
Max
Regards,
Max
I could never get this to work when I had the "validate['%checkEqual']" in the 1st email field and then in the second email field, a Field ID of "confirm_email".
What happened everytime was that as soon as I clicked on the confirm email field, the 1st one would pop up with the error message. So I figured that by clicking into a blank confirm field, this wouldn't validate with the entry in the entry email field.
So I reversed it. In the entry email field I placed a Field ID of "email_required".
Then in the confirm email field I put a field class of "validate['%checkEqual']".
Then in Max's js code I changed the validate field from 'confirm_email' to 'email_required'.
Now when I click out of the confirm email box and there not the same I get the error message🙂
Thanks Max!
What happened everytime was that as soon as I clicked on the confirm email field, the 1st one would pop up with the error message. So I figured that by clicking into a blank confirm field, this wouldn't validate with the entry in the entry email field.
So I reversed it. In the entry email field I placed a Field ID of "email_required".
Then in the confirm email field I put a field class of "validate['%checkEqual']".
Then in Max's js code I changed the validate field from 'confirm_email' to 'email_required'.
Now when I click out of the confirm email box and there not the same I get the error message🙂
Thanks Max!
Hi jumla16_guy,
Thanks for sharing!🙂
Regards,
Max
Thanks for sharing!🙂
Regards,
Max
Hi Bob,
It would be very helpful if this functrionality could be added to the Form Wizard as soon as possible. It really is a core function on most forms today.
Much Appreciated.
Brent
It would be very helpful if this functrionality could be added to the Form Wizard as soon as possible. It really is a core function on most forms today.
Much Appreciated.
Brent
Hi Brent,
There is a simpler solution posted by Bob here:
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=26&t=44281#p194412
Best regards,
Max
There is a simpler solution posted by Bob here:
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=26&t=44281#p194412
Best regards,
Max
This topic is locked and no more replies can be posted.