How can I validate that a date is available before prompting the user to complete the rest of a webform? I have a webform that contains a date field. I need to run some code that checks to make sure the date is not already in use (i.e. that no one else has submitted a webform with that particular date). I already have the webform validation module installed, and I know I could use that (create a custom module with custom validators), but the validations don't run until the form is submitted. Because there's a required file upload, I'd rather be able to allow the user to check if the date is available before doing the upload.

Is this possible? How would I go about it?
You have to use AJAX to check if the date is available.

In your form add a button to check for the date, for example:

  $form['submit-check'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; '('Check date'),
    '#ajax' =&gt; array(
      'callback' =&gt; 'mymodule_check_date_callback',
      'wrapper' =&gt; 'datecheck-result-wrp',
    ),
  );


When user clicks on the button, an AJAX call is made. inside the AJAX callback you can check the date availability and return the result in the callback fucntion (mymodule_check_date_callback() in the above example).

AJAX forms are beyond a simple answer, you'll have to check the documentation. I recoomend the Drupal 7 AJAX Forms documentation, the Example for Developers  module that includes AJAX form examples and the Form API Internal Workflow Illustration