# FormControlNode
Class Inherits TextNode
## About
`FormControlNode` is the shared base for HTML-compatible form controls. It stores common field attributes such as name, ID, associated form, required state, disabled state, accessibility metadata, and validation-related behavior.
Form controls may be placed inside a `FormNode` or used independently, matching HTML's `form` association model.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AddCommonPropertyMenuItems | menu As DesktopMenuItem | (None) | Adds the menu items for properties every form control shares, such as its ID, name, and associated form. |
| Constructor | (None) | (None) | Creates a new form-control node with no explicit form owner. |
| CopyFormPropertiesTo | target As FormControlNode | (None) | Copies the properties every form control shares to the supplied control. |
| EditingHandleReturn | (None) | Boolean | Handles Return by keeping single-line form-control values on one line. |
| ExportStyles | stylesheet As GraffitiProEditor.Stylesheet | (None) | Adds the stylesheet rules this node type's HTML output uses. |
| FormForegroundColor | (None) | Color | Returns the color used for the control's text and outline. |
| FromHTML | element As GraffitiProEditor.HTMLSupport.HTMLElement | Boolean | Restores the common form-control state from HTML. |
| FromJSON | data As JSONItem | Boolean | Restores the common form-control state from JSON. |
| HTMLFormAttributes | includeID As Boolean = True <br> includeStyle As Boolean = True | String | Returns the HTML attributes every form control shares, optionally including its ID and style. |
| ImportFormAttributes | element As GraffitiProEditor.HTMLSupport.HTMLElement | (None) | Applies the HTML attributes every form control shares from the supplied element. |
| InspectorSections | (None) | InspectorSection | Returns the common user-editable form-control properties exposed by the inspector. |
| PerformCommonPropertyAction | selectedItem As DesktopMenuItem | Boolean | Handles a menu item added by AddCommonPropertyMenuItems and returns whether it was handled. |
| PromptForText | dialogTitle As String <br> prompt As String <br> ByRef value As String | Boolean | Shows a dialog that asks for text and returns whether the user accepted it. The value is both the initial text and the result. |
| ToJSON | (None) | JSONItem | Returns the common form-control state as JSON. |
| VectorPDFControlBounds | pdf As PDFDocument <br> offsetX As Double <br> offsetY As Double <br> ByRef x As Double <br> ByRef y As Double <br> ByRef width As Double <br> ByRef height As Double | Boolean | Returns the control's bounds on a vector PDF page through its ByRef parameters, and whether it should be drawn as a PDF form field. |
| VectorPDFFieldName | usedNames As Dictionary | String | Returns a PDF form field name for the control that is not already in the supplied dictionary, and adds it. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| AutoFocus | Boolean | (None) | Gets or sets whether the control requests focus when the document loads. |
| Disabled | Boolean | (None) | Gets or sets whether the control is disabled. |
| FormID | String | (None) | Gets or sets the ID of an associated form element; an empty value leaves the control unassociated. |
| ID | String | (None) | Gets or sets the HTML element identifier used by labels and other references. |
| Name | String | (None) | Gets or sets the control name used for form submission. |
## Notes
Shared field behavior is inherited by the concrete form-control nodes.
### HTML Attributes
Subclass properties should map directly to supported HTML attributes. Export only meaningful values and restore them during HTML and JSON import. Inspector sections should use the user-facing name `Field` for common control attributes and reserve `Group` for radio-group state.
### JSON Format
The common form-control object adds Boolean `autoFocus` and `disabled` fields plus string `formID`, `id`, and `name` fields to its superclass JSON. Concrete controls append their own HTML-compatible state. Empty strings represent omitted HTML attributes when exported.
Each field is omitted at its default, `False` or an empty string, and restored to it when missing.