YouTip LogoYouTip

Att Button Form

# HTML ``` ### Attribute Values | Value | Description | | :--- | :--- | | `form_id` | The `id` of the `` element that the button belongs to. | --- ## Code Example In the example below, the submit button is located outside the `` element, but it is still fully functional and associated with the form via the `form="nameform"` attribute. ```html



The button below is placed outside the form element, but it still acts as the submit button for the form above.

``` --- ## Specifications and Browser Support ### HTML Version History * **HTML5:** Introduced as a new attribute. * **HTML 4.01:** Not supported. In HTML 4.01, form control elements had to be strict descendants of the `
` element. ### Browser Compatibility The `form` attribute is widely supported across all modern web browsers: * Google Chrome (Supported) * Mozilla Firefox (Supported) * Apple Safari (Supported) * Microsoft Edge (Supported) * Opera (Supported) * *Note: Legacy Internet Explorer (IE 11 and earlier) does not support this attribute.* --- ## Best Practices & Considerations 1. **ID Uniqueness:** Ensure that the `form_id` specified in the button's `form` attribute matches the `id` of the target form exactly. IDs are case-sensitive. 2. **Accessibility (a11y):** Screen readers correctly associate the external button with the form when using the `form` attribute, ensuring a seamless experience for users with assistive technologies. 3. **Multiple Forms:** While the HTML5 specification technically allows associating a button with multiple forms by using a space-separated list of IDs (e.g., `form="form1 form2"`), browser support for submitting multiple forms simultaneously via a single button is unreliable. For complex multi-form submissions, JavaScript is recommended.
← Att Button FormactionAtt Button Disabled β†’