Documentation
¶
Overview ¶
Package fieldset provides constructors and methods for the HTML <fieldset> element.
The <fieldset> HTML element groups related form controls and labels, providing semantic structure and visual organisation to forms. Often paired with a <legend> element to provide a caption. Useful for organising complex forms into logical sections, supporting accessibility by grouping related inputs, and enabling bulk enable/disable of controls via the disabled attribute.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<fieldset") TagClose = []byte("</fieldset>") AttrDisabled = []byte(" disabled") AttrForm = []byte(" form=\"") AttrName = []byte(" name=\"") )
Byte constants for HTML rendering.
Functions ¶
func Disabled ¶ added in v0.3.0
Disabled creates a disabled fieldset where all descendant form controls are inactive. The legend element and its contents are exempt from disabling. Useful for sections of a form that are conditionally unavailable. Example: fieldset.Disabled(legend.Text("Premium features"), input.Text("code", "")) Renders: <fieldset disabled><legend>Premium features</legend><input name="code" type="text" /></fieldset>
func Legend ¶ added in v0.3.0
Legend creates a fieldset with a legend and form controls. The legend is rendered as the first child, labelling the group. Example: fieldset.Legend("Address", input.Text("street", "")) Renders: <fieldset><legend>Address</legend><input name="street" type="text" /></fieldset>