first of all you can take a hidden field in form for ex. form_id initially it will be blank, it means it will create form.. when first time form saves it will be inserted to database. and then you return newly inserted id of the form to ajax response on ajax success you can set the hidden field value to newly created form id and now if id of form is passed to php scritp then you can use update query. else insert query.
Form auto save how to know is new or edit?
Frage
I want to implement the auto save form.
- I open the new form link
new-form.php
- Type the title then after 10 seconds it's save to database.
- Then I continue typing the whole form.
- Here, what is the
key
to update the previous saved content? And I'm still onnew-form.php
What is the logic to save new entry & update after auto save.
Let me know.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow