// isValidForInput checks if fType is a valid value for the `type` property of an HTML input element.
funcisValidForInput(fTypestring)bool{
validInputTypes:=strings.Fields("text password checkbox radio submit reset hidden image file button search email url tel number range date month week time datetime datetime-local color")
for_,validType:=rangevalidInputTypes{
iffType==validType{
returntrue
}
}
returnfalse
}
// parseFormTag takes the stuct-tag of a StructField and parses the `form` value.
// returned are the form label, name-property, type and wether the field should be ignored.