jQuery Inline Edit

jQuery Inline Edit

I’m trying to get the QuickEdit code below to work with IE…it works fine with FF.

Anyone able to help?

  1. <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
    (function($) {
    $.fn.inlineEdit = function(options) {
        options = $.extend({
            hoverClass: 'hover'
        }, options);
        return $.each(this, function() {
            var self = $(this);
            var id = $(this).attr('id');
            self.value = self.text();
            self.bind('click', function() {
                self
                    .html('<input type="text" id="'+ id +'" value="'+ self.value +'">')       
                    .find('input')
                    .bind('blur', function(event) {
                        $.post("/_ajax/quick_save",{
                            id: $(this).attr('id'),
                            value: $(this).val()
                        });
                        self.value = $(this).val();
                        self.text(self.value);
                    })
                    .focus();
                })
                .hover(
                    function(){
                        self.addClass(options.hoverClass);
                    },
                    function(){
                        self.removeClass(options.hoverClass);
                    }
                );
            });
        }
    })(jQuery);
    $(function(){
        $('.editable').inlineEdit();
    });
    </script>
    <span id="policy_code" class="editable">DP-001<span>