HTML <object> form attribute

Definition and Usage

form The attribute specifies the form to which the object belongs.

The value of this attribute must be equal to the same document <form> the id attribute of the element.

Example

An <object> element located outside the form (but still part of the form):

<form action="/action_page.php" id="form1">
  First name: <input type="text" name="fname"><br>
  <input type="submit" value="Submit">
</form>
<object data="tulip.jpg" width="300" height="300" form="form1"></object>

Try It Yourself

Syntax

<object form="form_id">

Attribute Value

Value Description
form_id

Specifies the <form> element that the <object> element belongs to.

The value of this attribute must be the id attribute of the <form> element in the same document.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Not Supported Not Supported Not Supported Not Supported Not Supported