HTML <object> form Attribute

The form attribute on an <object> tag specifies the form the object is associated with. Although linked to the form, the object is not included in form submission.

Example

#

A form attribute on an <object> element.
The embedded image is associated with the form above it.

Art Information


<form action="/tutorial/action.html" id="document-form"
      oninput="result.value = slider.value">
  <fieldset>
    <legend>Art Information</legend>
    <input type="text" name="name" 
           placeholder="Title of painting"><br /><br />

    <input type="submit" value="Submit">
  </fieldset>
</form> <br />

<object form="document-form" data="/img/html/poppies.jpg" 
        type="image/jpg" name="poppies">
</object>


Note:  The object value is not submitted during form submission.


Using form

The form attribute specifies the form the object is associated with.

The attribute value is the id of the form.

The object value is not included during form submission.

Note: The form attribute on the object tag has been deprecated.


Syntax

<object form="form-id">

Values

#

Value Description
form-id The id value of the form.

Browser support

Here is when form support started for each browser:

Chrome
Not Supported
Firefox
Not Supported
IE/Edge
Not Supported
Opera
Not Supported
Safari
Not Supported

You may also like

 Back to <object>
Guides