Closed (fixed)
Project:
Webform
Version:
5.x-2.3
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2008 at 17:07 UTC
Updated:
9 Feb 2010 at 05:47 UTC
I was trying to figure out what code in need to not let a user submit a for if that email address they have put in has already been used on the form. the code i have so far is:
$count = $count = db_result(db_query(“select count(*) from {webform_submitted_data} where nid = %d and lower(data)=lower('%s')” ,
$node->nid, $form_values‘submitted’]email’]));
if ($count > 0){
form_set_error('submitted][email', t('This email address has already been used.'));
But when I enter this into the Validation field it make all the rules in the validation field be ignored and it accepts all submission.
Comments
Comment #1
pebosi commentedHi,
i created a patch adding an option for this for drupal 6 version here: #346155: Validation option to set component values as unique
maybe you can port for your version of webform or update to 6 :)
regards
Comment #2
quicksketchNew features are only being added to the 3.x version. Now that #346155: Validation option to set component values as unique has been committed, we can close this one up.