有的時候
function formIsDirty(form) {
for (var i =
var element = form
var type = element
if (type == "checkbox" || type == "radio") {
if (element
return true;
}
}
else if (type == "hidden" || type == "password" || type == "text" || type == "textarea") {
if (element
return true;
}
}
else if (type == "select
for (var j =
if (element
return true;
}
}
}
}
return false;
}
window
e = e || window
if (formIsDirty(document
if (e) {
e
}
return "You have unsaved changes
}
};
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20449.html