Global Submission validation based on a select item Is there a way to get Drupal 7 / Webforms to block a submission for a duplicate answer in a previous submission.  I am sending an application questionnaire to multiple app owners, the form is setup with a listbox containing the App name, then the rest of the form is generic for each app.  I would like for the App owners to not be able to accidentally submit for the same app twice.

Many people have suggested the "Webform Validation" module, but as far as I can tell, it only does validation on the form itself.  It cannot do validation for the form being submitted against previously submitted forms.

TIA
If I understood your question correctly, Webform supports this out of the box.

Edit the "app name" field and under "Validation" select the "Unique" checkbox:


  Check that all entered values for this field are unique. The same value is not allowed to be used twice.


This will make sure that each webform entry has a unique value for this field, meaning that duplicates will not be allowed.



UPDATE

Here is a sample code that will allow you to validate the webform submissions.

Create a new folder called custom in sites/all/modules, and then another folder called sample in custom.

Place the following in sample.info file:

name = Sample
description = Sample custom module that provides custom webform validation rules.
package = Custom
core = 7.x
version = 7.x-1.0


Place the following in sample.module file:

/**
 * Implements hook_form_alter().
 */
function sample_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // Make sure that we are selecting the webform forms.
  if (substr($form_id, 0, 20) == 'webform_client_form_') {
    $form['#validate'][] = 'sample_webform_validate';
  }
}

/**
 * Sample validation callback.
 */
function sample_webform_validate($form, &amp;$form_state) {
  // Replace this with the name of your field, cid (webform component ID) and
  // nid.
  $field_name = 'select_something';
  $cid = 1;
  $nid = 4;
  // Check if this is a duplicate.
  $is_duplicate = db_select('webform_submitted_data', 'd')
    -&gt;fields('d')
    -&gt;condition('nid', $nid)
    -&gt;condition('cid', $cid)
    -&gt;condition('data', $form_state['values']['submitted'][$field_name])
    -&gt;execute()
    -&gt;fetchObject();
  if ($is_duplicate) {
    form_set_error($field_name, t('Duplicate value, please select something else.'));
  }
}