A large amount of spam entries are being made where the first name and the last name are the same. I'd love to use Webform Validation to prevent this from happening.

Comments

CiviFirst John created an issue. See original summary.

civifirst john’s picture

Added a change to the value comparison operator. Considered adding "equals" to the operator, but didn't as it's a separate option already.

civifirst john’s picture

Patch added

liam morland’s picture

Version: 7.x-1.15 » 7.x-1.x-dev

How about implementing this by making the "Equal values" validator accept the negate option?

3li’s picture

Status: Active » Needs review
StatusFileSize
new1.59 KB

Needed the ability to negate equals value, patch attach does this.

liam morland’s picture

Status: Needs review » Needs work
StatusFileSize
new1.49 KB

Thanks for the patch. Patches need to be made from the module directory. This means that they do not include "sites/all/modules" etc. They also need to be made with unix-style line endings. Otherwise, they won't apply and be tested by the automated testing. Attached is a re-roll of the patch.

This works for ensuring that two components have different values. For three or more, it only checks that they later components are different from the first, not that they are all different from each other, which I think is what is implied by this validator.

liam morland’s picture

Title: Feature Request: check two field values are not the same » Make equal values validator negatable
ayduns’s picture

Doesn't the existing 'Unique values' rule cover this case? Add a 'Unique values' rule and choose the first and last name fields.

liam morland’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.