How to validate webform with JavaScript?
You can create a custom module for that:


webfv.info
webfv.module
webfv.js


Put all these files into a folder called webfv.



This is the webfv.module file:

&lt;?php
function webfv_form_comment_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form['#id'] == 'webform-client-form-80') {
    $form['#attached']['js'][] = array(
    'data' =&gt; drupal_get_path('module', 'webfv') . 'webfv.js', 
    'type' =&gt; 'file',
  );
}
}




And this is the webfv.js file:

    (function($) {
      $(document).ready(function() {
      // Put your code here. //
      });
    }) (jQuery);




And of course, you should have a webfv.info file:

name = webfv
description = JavaScript Webform Validation
core = 7.x
files[] = webfv.module


Note: this is just one way of doing it, there are some other ways.