Open In App

HTML | <fieldset> form Attribute

Last Updated : 21 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML | <fieldset> form Attribute is used to specify the one or more forms that the <fieldset> element belongs to
Syntax: 

<fieldset form="form_id">

Attribute Values: 

  • form_id: It contains the value i.e form_id which specify the no. of forms that the <fieldset> element belongs to. The value of this attribute should be the id of the <form> element. 
     

Example:  

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML fieldset form Attribute
    </title>
    <style>
        h1,
        h2,
        .title {
            text-align: center;
        }
         
        fieldset {
            width: 50%;
            margin-left: 22%;
        }
         
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>
      HTML &lt;fieldset&gt;
      form Attribute
  </h2>
    <form id="mygeeks">
        <div class="title">
            Suggest article for video:
        </div>
    </form>
   
    <fieldset form="mygeeks">
        <legend>JAVA:</legend>
        Title:
        <input type="text">
        <br> Link:
        <input type="text">
        <br> User ID:
        <input type="text">
    </fieldset>
    <br>
    <fieldset form="mygeeks">
        <legend>PHP:</legend>
        Title:
        <input type="text">
        <br> Link:
        <input type="text">
        <br> User ID:
        <input type="text">
    </fieldset>
 
</body>
 
</html>


Output : 
 

Supported Browsers: The browser supported by HTML <fieldset> form Attribute are listed below: 

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


Similar Reads

How to achieve &lt;fieldset&gt; like effect without using &lt;fieldset&gt; tag ?
Forms are used to make a group for more understandable of all users and clients, as related data fields are easier to identify. It also makes it easier for users to concentrate on smaller and more clearly defined groups by understanding them one by one as an individual rather than try to grasp the entire form at once. The grouping has to be created
3 min read
HTML &lt;fieldset&gt; disabled Attribute
The disabled attribute for &lt;fieldset&gt; element in HTML is used to specify that the group of related form elements is disabled. A disabled fieldset is un-clickable and unusable. It is a boolean attribute. Syntax: &lt;fieldset disabled&gt;fieldset content...&lt;/fieldset&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt;
1 min read
HTML | &lt;fieldset&gt; autocomplete attribute
The HTML &lt;fieldset&gt; autocomplete attribute is used to specify that the fieldset has autocompleted on or off value. When the autocomplete attribute is set to on the browser will automatically complete the values base on which the user entered before. Syntax: &lt;fieldset autocomplete="on | off"&gt; Attribute Values: on: It has a default value.
1 min read
HTML &lt;fieldset&gt; name Attribute
The HTML &lt;fieldset&gt; name Attribute is used to specify the name for the Fieldset element. It is used to reference the form data after submitting the form or to reference the element in JavaScript. Syntax: &lt;fieldset name="text"&gt; Attribute Values: It contains the value i.e. name which specifies the name for the fieldset element. Example: I
1 min read
HTML | DOM Fieldset form Property
The Fieldset form property in HTML DOM is used to set or return the reference to the form that containing the &lt;fieldset&gt; element. It is read-only property that returns a form object on success. Syntax: fieldsetObject.form Return Value : It returns a string value representing the reference of the form to which the fieldset element belongs. The
2 min read
HTML | DOM Fieldset disabled Property
The Fieldset disabled Property in HTML DOM is used to set or return whether a fieldset is disabled or not. A Disabled element is unusable and un-clickable and is usually rendered grey in color by Default. This Property is used to reflect the HTML disabled attribute. Syntax: It returns the disabled property:fieldsetObject.disabledIt is used to set t
2 min read
HTML | DOM Fieldset Object
The DOM Fieldset Object is used to represent the HTML &lt;fieldset&gt; element. The fieldset element is accessed by getElementById(). Properties: disabled: disabled property used to set or return whether a fieldset is disabled, or not.form: use to return a reference to the form that contains the fieldset.name: Value of name attribute of field is se
2 min read
HTML | DOM Fieldset name Property
The Fieldset name Property in HTML DOM is used to set or return the value of the name attribute of a fieldset element. The name attribute is used to specify the name of the fieldset field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the Fieldset name property. fie
2 min read
HTML | DOM Fieldset type Property
The DOM Fieldset type Property in HTML DOM is used to set or returning the which type of form element the fieldset is. It is a read-only property and will always return "fieldset". Syntax: fieldsetObject.type Return Value: It returns a string value, which represents the type of form element the fieldset is. Below Program that illustrates the use of
1 min read
How to specify a name for the fieldset using HTML ?
The &lt;fieldset&gt; tag in HTML5 is used to make a group of related elements in the form and it creates the box over the elements. The &lt;fieldset&gt; tag is new in HTML5. The HTML &lt;fieldset&gt; name attribute is used to specify the name for the fieldset element. It is used to reference the form-data after submitting the form or to reference t
1 min read