NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 459 forks source link

Issue with jalert #115

Closed TahsinGokalp closed 10 years ago

TahsinGokalp commented 10 years ago

$(".bilgi4").editable("'.site_url().'kullanici/guncelle/sifre", { onsubmit: function() { jConfirm("Şifrenizi değiştirmek istiyor musunuz?", "Onay", function(r) { return (r);
}); return false;
}, indicator : '', type : 'text', cancel : '

',
submit : '
', }); When i click submit button confirmation dialog opening but before i answer the question
form post itself.

TahsinGokalp commented 10 years ago

Problem solved.

$(".bilgi4").editable("http://google.com", { onsubmit: function(settings, ele) { var confirmed = $(ele).data('editConfirmed'); $(ele).data('editConfirmed', false);

    if (! confirmed) {
        jConfirm('Title', 'Are you sure?', function(r) {
            if (r) {
                $(ele).data('editConfirmed', true);
                $(ele).find('form:eq(0)').submit();
            } else {
                $(ele).data('editConfirmed', false);
            }
        });
    }

    return confirmed === true;
},
onblur    : 'ignore',
type      : 'text',
cancel    : '<div class="iptalbuton2">Cancel</div>',
submit    : '<div class="kaydetbuton">Submit</div>',

});