Appnitro Software Forums » MachForm

Check field values are the same

(3 posts)

  1. dennis
    Member

    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..

    Posted 2 months ago #
  2. 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

    Posted 2 months ago #
  3. dennis
    Member

    Yep - that worked... Thanks...

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.