"use strict";
(function ($) {
    $.field_fieldname = function (element, options) {
        var defaults = {
            input_name: ""
        }
        var plugin = this;
        plugin.settings = {}
        var $element = $(element), 
            element = element;    
        
        plugin.init = function () {
            $element.keyup(function() {
                this.value = this.value.replace(/\s/g,'_');
                this.value=this.value.toLowerCase();
            });

        }
        plugin.example_function = function () {
        };
        plugin.init();
    }
    
    $.fn.field_fieldname = function (options) {
        
        return this.each(function () {
            
            if (undefined == $(this).data('field_fieldname')) {
                var plugin = new $.field_fieldname(this, options);
                $(this).data('field_fieldname', plugin);
            }
        });
    }
})(jQuery);
