about summary refs log tree commit diff stats
path: root/html/attributes.go
diff options
context:
space:
mode:
authorStéphane Legrand2025-02-03 14:43:40 +0100
committerGitHub2025-02-03 13:43:40 +0000
commitceb0e8e26d0c0b2e96952176702efa442af55008 (patch)
tree26f2804b0d1288c31a62dbd431b3838a8c741165 /html/attributes.go
parentc366cfc3574daf7b31e4fa68790c29fc72f7b74b (diff)
downloadgomponents-ceb0e8e26d0c0b2e96952176702efa442af55008.tar.lz
gomponents-ceb0e8e26d0c0b2e96952176702efa442af55008.tar.zst
gomponents-ceb0e8e26d0c0b2e96952176702efa442af55008.zip
Add formxxx attributes (for <input type="submit"> element) (#241)
Hello,

A small patch to add the following attributes:

- formaction
- formenctype
- formmethod
- formnovalidate
- formtarget

These attributes are useful in `<input type="submit">` element: [MDN
documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit#additional_attributes)
Diffstat (limited to 'html/attributes.go')
-rw-r--r--html/attributes.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go
index e4cd796..6da541d 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -141,10 +141,30 @@ func For(v string) g.Node {
 	return g.Attr("for", v)
 }
 
+func FormAction(v string) g.Node {
+	return g.Attr("formaction", v)
+}
+
 func FormAttr(v string) g.Node {
 	return g.Attr("form", v)
 }
 
+func FormEncType(v string) g.Node {
+	return g.Attr("formenctype", v)
+}
+
+func FormMethod(v string) g.Node {
+	return g.Attr("formmethod", v)
+}
+
+func FormNoValidate() g.Node {
+	return g.Attr("formnovalidate")
+}
+
+func FormTarget(v string) g.Node {
+	return g.Attr("formtarget", v)
+}
+
 func Height(v string) g.Node {
 	return g.Attr("height", v)
 }