How do I validate form elements via onblur events? I am trying to validate a form element when it loses focus. But I am having issues calling the validation script.
I have tried both:

drupal_add_js('(
    function ($)
        {
        $("#edit-field-organization-url").blur(
            function()
                {
                //alert(\'jQuery Exec!\');
                $(this).validate();
                }
        );
        }(jQuery));', 'inline');


and

$form['field_organization_url']=array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Website URL'),
    '#weight' =&gt; 2,
    '#size' =&gt; 60,
    '#maxlength' =&gt; 128,
    '#value' =&gt; 'www.google.com',
    '#description' =&gt; t('Enter website URL.'),
    '#element_validate' =&gt; array('hook_node_validate'),
    '#attributes' =&gt; array(
        //'onblur'=&gt; '$(this).validate();'),
        //'onblur'=&gt; 'alert(\'jQuery Exec!\');')
    '#required' =&gt; TRUE
    );


but neither work. I'm guessing this isnt the proper drupal way to call the validation functions.

#########################

UPDATE

#########################

I still cant seem to get it working. The validation code now runs every time the page is loaded and doesnt seem to be tide to the onblur event even though I have it set in the clientside_ validation module:


  file - template.php:


function THEME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
switch ($form_id) {
case 'custom_content_type_node_form':
$form['custom_content_type_node_form']=array(
'#type' =&gt; 'textfield',
'#title' =&gt; t('Website URL'),
'#value' =&gt; 'http://www.google.com',
'#description' =&gt; t('Enter website URL.'),
'#element_validate' =&gt; array('hook_clientside_validate_url'),
'#required' =&gt; TRUE);`

file - custom.module:
`function hook_clientside_validation_rule_alter(&amp;$js_rules, $element, $context) {
switch($context['type']) {
case 'element_validate':
if (in_array('hook_clientside_validate_url', $context['functions'])) {
hook_clientside_validate_url($js_rules, $element);
}
function hook_clientside_validate_url($js_rules, $element) {
//validation code here
}`
Drupal doesn't have any client-side validation by default, but you can get that functionality with the Clientside Validation module:


  This module adds clientside validation (aka "Ajax form validation") for all forms and webforms using jquery.validate.


According to the docs it has a "Validate on blur" option, so it should be just what you're looking for.