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

pebosi’s picture

Hi,

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

quicksketch’s picture

Status: Active » Closed (fixed)

New 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.