I created a webform with 2 fields. These fields together should be unique, ie it should not be able to send 2 form with the same values ​​of the fields, but not individually. I created an "unique values" rule with the module webform validation and selected both of the webform fields but the form is still submitted even if it is identical to other previously submitted.

I enclose a picture with an example.

CommentFileSizeAuthor
Unique Field validation.png280.22 KBhaunted
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Liam Morland’s picture

Thanks for the report. Please test with the latest development version and let me know if the problem still exists there.

haunted’s picture

I tested with version 7.x-1.x-dev and the problem persists.

Liam Morland’s picture

Title: Validation rule "unique values" doesn't works. » Validation rule "unique values" doesn't work
Version: 7.x-1.4 » 7.x-1.x-dev
Priority: Critical » Normal
Liam Morland’s picture

Component: Validation rules » User interface
Assigned: Unassigned » Liam Morland

Unique means unique on that form. In the case of your example, it means that author and title could not have the same value. If you want it such that each title or author cannot be used in more than form submission, use the unique validation option provided by Webform on the Edit Component page.

I will improve the UI to make this distinction clear.

Liam Morland’s picture

Priority: Normal » Minor
Liam Morland’s picture

Title: Validation rule "unique values" doesn't work » Improve description of unique validator

  • Commit fd8e54e on 7.x-1.x by Liam Morland:
    Issue #2221561: Improve description of unique validator.
    
Liam Morland’s picture

Status: Active » Fixed
haunted’s picture

Sorry for the misunderstanding, I thought that it compared the values ​​with those of the previous submissions. However, the unique validation option provided by Webform on the Edit Component page, works for the individual fields and not for a combination of them, so it is not useful for my purposes.

Liam Morland’s picture

You can write a custom validator using the hooks in Webform Validation to meet your specific need.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.