Welcome Guest, Not a member yet? Register   Sign In
jQuery Inline Edit
#1

[eluser]Total Shop UK[/eluser]
I'm trying to get the QuickEdit code below to work with IE...it works fine with FF.

Anyone able to help?

Code:
<ѕcript 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('&lt;input type="text" id="'+ id +'" value="'+ self.value +'"&gt;')        
                .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();
});
</ѕcript>

Code:
<span id="policy_code" class="editable">DP-001<span>


Messages In This Thread
jQuery Inline Edit - by El Forum - 03-29-2011, 09:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB