//使用jQuery實現 $("#fm :input").change(function() { $("#fm").data("changed",true); }); //提交前判斷 if ($("#fm").data("changed")) { // submit the fm }