Update attach-form.js

This commit is contained in:
Biser Stoilov
2018-02-18 15:26:04 +02:00
committed by GitHub
parent 6557b59b9f
commit 7148e8bf6e

View File

@@ -50,19 +50,16 @@ var formAction = function(el, event) {
// jscs:disable disallowImplicitTypeConversion
if (!!element.name && element.attributes !== undefined && element.tagName.toLowerCase() !== "button") {
// jscs:enable disallowImplicitTypeConversion
var elementType
var elementType = "undef"
if (element.tagName.toLowerCase() === "input") {
if (element.type === "checkbox") {
elementType = "checkbox"
}
if (element.type === "radio") {
else if (element.type === "radio") {
elementType = "radio"
}
else {
elementType = "other"
}
}
if (element.tagName.toLowerCase() === "select") {
else if (element.tagName.toLowerCase() === "select") {
elementType = "select"
}
if ((elementType !== "checkbox" && elementType !== "radio") || element.checked) {