I would like to have the email address entered twice and then a quick check to ensure that the values are the same.
Is there a (hopefully easy) way to do this please ?
Thanks..
Started 3 years ago by dennis | 7 posts |
I would like to have the email address entered twice and then a quick check to ensure that the values are the same.
Is there a (hopefully easy) way to do this please ?
Thanks..
If you don't mind some modification, yes it is possible.
Let say your form is having id = 3 and your email fields are having id element_1 and element_2 (check the HTML source of your form to see it.
Edit your includes/post-functions.php, around line 46 - 47 you'll find this code:
$element_child_lookup['address'] = 5;
$element_child_lookup['simple_name'] = 1;
Right above that code, insert this code:
if($form_id == 3){
if($input['element_1'] != $input['element_2']){
$process_result['status'] = false;
$process_result['custom_error'] = 'You must enter the same email address!';
}
}
That would do it.
If you are having difficulty, let me know the URL of your form or just send it to customer.service [at] appnitro.com
MachForm Founder
Yep - that worked... Thanks...
The above solution DOES work great.
I have a website that has about 10 email addresses on it. We are being spammed by bots that are finding the addresses on our site. I have decided to create a form for each recipient. All the forms are identically layed out. Will I have to put this code in 10 times?
f($form_id == 13){
if($input['element_2'] != $input['element_3']){
$process_result['status'] = false;
$process_result['custom_error'] = 'You must enter the same email address!';
}
}
and change the form id each time, or is there a way to say >=13 and <=23 on the form_id line?
Bump
Are all your forms having the identical email fields element id?
(if you copied your form using the 'duplicate' button, usually they are identical)
If they do, you can use something like this:
if($form_id >= 3 && $form_id <= 23){
if($input['element_1'] != $input['element_2']){
$process_result['status'] = false;
$process_result['custom_error'] = 'You must enter the same email address!';
}
}
otherwise, you'll need to put separate 'if' block for each form.
MachForm Founder
works great!
You must log in to post.