开发者

Jeditable reset() with a specific value

开发者 https://www.devze.com 2023-02-09 15:44 出处:网络
I\'m using jeditable 1.7.1 and what I\'m trying to do is reset the form with a custom value. So for example, if the user clic开发者_运维问答ks outside of the form (triggering the reset) I want to be a

I'm using jeditable 1.7.1 and what I'm trying to do is reset the form with a custom value. So for example, if the user clic开发者_运维问答ks outside of the form (triggering the reset) I want to be able to set the value of the content. Something along the lines of reset("new content") or content("my custom content"). Is there a way to do this? Or will I have to modify the original source code?

I could always just set the content manually with this.html("put my new stuff here") but then it looses it's 'editable' properties.

Thanks in advance!


You have just to add this option: onblur: "submit". With this option, if you click outside the form, it anyway submit the content.

Example:

$('.edit').editable('http://page.php', {
     onblur: "submit"
 });

Hope this was your problem!

0

精彩评论

暂无评论...
验证码 换一张
取 消