﻿// jquery.form-focus.js
// --------------------
// Sets the initial form focus to the element
// specified in the jQuery selector.
//
//  @author:    ian oxley
//  @date:      2008-05-19
//
jQuery.fn.formFocus = function() {
    return this.each(function() {
        var current = jQuery(this);
        var initialValue = current.val();
        if (initialValue.length > 0) {
            return;
        }
        current.get(0).focus();
    });
};