The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Validation or Confirm Email

Is there anyone to make your email field to validate or confirm to the second email field like the attached image.

If anyone can help would be appreciate! Smile

Attached Files Thumbnail(s)
Yes, I would like that too!
(Apr 16th, 2016, 7:27 AM)jpmd Wrote: Yes, I would like that too!

Validation Rules will do that.  I'm doing that exact thing on my form.  It is external however, so I'm not sure what your using.

PHP Code:
$fields ft_api_init_form_page(2);

// validation time!
$errors = array();
if (isset(
   $rules = array();
    $rules[] = "valid_email,emailaddress,Please enter a valid email address.";
    $rules[] = "same_as,emailaddress,emailaddress2,Please insure your confirmation email is the same.";
    $errors validate_fields($_POST$rules);
// no errors - great! Now we process the page. The ft_api_process_form does
// the job of both updating the database and redirecting to the next page
   if (empty($errors))
       $params = array(
           "submit_button" => "sbmt",
            "next_page" => "",
            "form_data" => $_POST,
            "finalize" => true
// it failed validation. Update $fields with the latest contents of the form data
       $fields array_merge($_SESSION["form_tools_form"], $_POST);

Then in my form, I have this for the 2 email fields to compare.

PHP Code:
       <td align="right" valign="top" width="35%">Email Address<br>
       <td valign="top" width="618"><input maxlength="40" size="40" type="text" name="emailaddress" value="<?=@$fields["emailaddress"]?>" /> *-Required</td>
       <td align="right" valign="top" width="35%">Confirm Email Address<br>
       <td valign="top" width="618"><input maxlength="40" size="40" type="text" name="emailaddress2" value="<?=@$fields["emailaddress2"]?>" /> *-Required</td>

Hope this helps.


Forum Jump:

Users browsing this thread: 1 Guest(s)