我使用JavaScript来做到过滤器只更新值
1 - I use hashes.js to calculate a sha1 when page loaded. store it in hidden or just a variable, or you can do sha in the server.
2 - I also do a snapshot of the form in array when page loaded. I put all my input in one class and use jQuery('forminputs').each to put them in array.
3 - when user click submit, first I do another snapshot of the form as No. 2 and compare the hash. if the hash diff, I use php.js get the updated value php.array_diff_assoc(newsnapshot, oldsnapshot). and post this to server.
虽然这些看起来很多计算的,但实际上它不是在Firefox或Chrome(永远不要试图IE)在所有放缓。
改变方法。把旧的价值放在文本框中,让用户在那里改变。如果它相同(即用户没有触及它),MySQL会注意到这一点并且不会更新它。 – itachi 2013-04-22 07:33:46
@itachi但我维护所有更新的日志表。我如何仅使用修改后的值更新日志表? – ben 2013-04-22 07:48:20
哈哈,你应该早点提到它。 – itachi 2013-04-22 07:57:34