Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
Unique Field validation.png | 280.22 KB | haunted |
Comments
Comment #1
Liam MorlandThanks for the report. Please test with the latest development version and let me know if the problem still exists there.
Comment #2
haunted CreditAttribution: haunted commentedI tested with version 7.x-1.x-dev and the problem persists.
Comment #3
Liam MorlandComment #4
Liam MorlandUnique 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.
Comment #5
Liam MorlandComment #6
Liam MorlandComment #8
Liam MorlandComment #9
haunted CreditAttribution: haunted commentedSorry 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.
Comment #10
Liam MorlandYou can write a custom validator using the hooks in Webform Validation to meet your specific need.