Add custom jQuery to form as a module
You have different ways/options to add custom javascript/jQuery file with your module.

Option 1: Add myscript.js in module info file (mymodule.info).

scripts[] = js/myscript.js


Option 2: Add myscript.js using hook_init and drupal_add_js

function mymodule_init() {
  drupal_add_js(drupal_get_path('module', 'MODULE_NAME') .'/js/myscript.js', 'file');
}


Option 3: Add myscript.js to any Drupal form or any callback that contains Drupal form

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['#attached']['js'][] = array(
    'data' =&gt; drupal_get_path('module', 'MODULE_NAME') . '/js/myscript.js', 
    'type' =&gt; 'file',
  );
}