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
Opposite of same_as
Hey guys -

Not sure if this can be done with reg_exp or not, but I'd like to create a PHP validation rule that is exactly the opposite of same_as. For example, on a form, the customer is allowed to choose their 1st choice and their 2nd choice, but I don't want to let them choose the SAME choice in both fields. Each of the 1st and 2nd choices needs to be different from each other. Any thoughts?


I can see in the validation.php file where the same_as rule is written, and I could easily just create another case in that file, but I want to make sure it never gets overwritten (you know, like a WP child theme's functions.php).

PHP Code:
case "same_as":
        if (
$fields[$field_name] != $fields[$field_name2])
$errors[] = $error_message;
Not a FT employee, just a FT user lending a hand. If I've been helpful, please rate.

[Image: giraffe_long_85.gif]
Use different codes to understand the nature of work and always try to make sure you learn something new. The phd writing service shares some more in working and help others if you understand their way of teaching.

Forum Jump:

Users browsing this thread: 1 Guest(s)