Fix incorrect detection of form method if there is an input tag with the name 'method'

This commit is contained in:
Kijin Sung 2017-04-01 22:07:38 +09:00
parent 36c36cc19b
commit 0777a66703

View file

@ -204,10 +204,10 @@
jQuery(function($) {
/* CSRF token */
$("form[method]").filter(function() { return this.method.toUpperCase() == "POST"; }).addCSRFTokenToForm();
$("form[method]").filter(function() { return String($(this).attr("method")).toUpperCase() == "POST"; }).addCSRFTokenToForm();
$(document).on("submit", "form[method='post']", $.fn.addCSRFTokenToForm);
$(document).on("focus", "input,select,textarea", function() {
$(this).parents("form[method]").filter(function() { return this.method.toUpperCase() == "POST"; }).addCSRFTokenToForm();
$(this).parents("form[method]").filter(function() { return String($(this).attr("method")).toUpperCase() == "POST"; }).addCSRFTokenToForm();
});
/* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */