Hi,
is it possible to check that two fields match? i am looking to have a confirm email field.
thanks,
Gareth
thanks paul, looks great, but i was wondering if there is any one to do this using the inbuilt email validation messages.
Realise its been a while since the last post but wondered if someone can explain how to implement this function onValidateFunction on the server side? And what the form code should look like
Thanks
Hi Guys.
Big slim:
This is how I did it.
My snippet call:
[[OnBeforeMailSent]]
[[eForm? &formid=`MyForm` &to=`
[email protected]` &from=`
[email protected]` &subject=`Newsletter Sign-up` &tpl=`Newsletter_Chunk` &report=`newsletterreport` &eFormOnValidate=`confirmeamils`]]
The I created a snippet named confirmeemail with TobyL’s function (thank you toby!):
function confirmeamils(&$fields, &$vMsg, &$rMsg, &$rClass){
if($fields['email'] != $fields['email2']){
//we have an error
$vMsg['email'] = "The two email addresses do not match!";
$rClass['email'] = $rClass['email2'] = 'invalid';
}
return true; //important
}
Hope that will help you.
Regards,
Mamu
Thank you for Modx, and thank you for your help.