开发者

Triggering new extra forms in django admin

开发者 https://www.devze.com 2023-04-03 06:32 出处:网络
Is there a开发者_JAVA技巧 way to trigger new extra form adding in django inline form? I mean, when user clicks \"Add new inline\", I would like to execute some javascript

Is there a开发者_JAVA技巧 way to trigger new extra form adding in django inline form?

I mean, when user clicks "Add new inline", I would like to execute some javascript code in the meantime.

Cheers, Tomek


Yes! You have to use http://api.jquery.com/trigger/ like this:

$('a').click(function(){ 
    $("form:first").trigger("submit");
});
0

精彩评论

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