Jquery checks whether the data of the form has changed.

jquery checks whether the data in the form has changed. If you don"t find any change, you don"t need to save the data. If you change, you can save it. Is there such a plug-in, or what is the idea

?
Mar.09,2021

add a flag:false tag, as long as a certain item of data changes flag=true. It can be saved only when flag=true.
flag=false button is grayed out or click to prompt


Save the json data of the form after saving or initializing, and judge whether it is consistent with the previous json when saving
for example

let oldForm
init(){
    let oldForm = JSON.stringify(form)
}
submit(){
    let newForm = JSON.stringify(form)
    if(newForm == oldForm){
        ...
        return
    }
    ...
}
Menu