Ajax - How to save automatically my Django form

我只是一个虾纸丫 提交于 2019-12-09 06:37:00

问题


i have an add_form under my django app. i want to add a feature this form which is saving form automatically after user starts to type.

like in gmail , or blogger.

what are the steps i should follow? which way or plugin? and how to use them?

any knowlenge can help me.thank you.


回答1:


There's two useful jquery plugins to get you started

https://github.com/BenGriffiths/jquery-save-as-you-type which saves what you type locally to a cookie client-side. Using this plugin is simpler and you will only need to actually save into your django backend when the user hits your form's "save" button.

and

https://github.com/nervetattoo/jquery-autosave which requires that you set up an intermediary model (perhaps a Draft model) in django to keep track of updates along the way. And when the user finally hits save, a final copy of the data is then saved into the actual model.



来源:https://stackoverflow.com/questions/13476816/ajax-how-to-save-automatically-my-django-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!