From ceb0e8e26d0c0b2e96952176702efa442af55008 Mon Sep 17 00:00:00 2001
From: Stéphane Legrand
Date: Mon, 3 Feb 2025 14:43:40 +0100
Subject: Add formxxx attributes (for element) (#241)
Hello,
A small patch to add the following attributes:
- formaction
- formenctype
- formmethod
- formnovalidate
- formtarget
These attributes are useful in `` element: [MDN
documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit#additional_attributes)---
html/attributes.go | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
(limited to 'html/attributes.go')
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)
}
--
cgit 1.4.1