fieldset disabled - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:fieldset

Introduction

You can also disable multiple input elements in a single step by applying the disabled attribute to the fieldset element.

When you do this, all of the input elements contained by fieldset will be disabled.

Disabling the input Elements Using the fieldset Element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <form method="post" action="http://example.com/form"> 
         <fieldset> 
            <legend>Enter Your Details</legend> 
            <p>
               <label for="name">
                  Name: <!--   www.  j  av a  2s .  c  om-->
                  <input id="name" name="name">
               </label>
            </p> 
            <p>
               <label for="name">
                  City: 
                  <input id="city" name="city">
               </label>
            </p> 
         </fieldset> 
         <fieldset disabled> 
            <legend>Vote For Your Three Favorite</legend> 
            <p>
               <label for="fave1">
                  #1: 
                  <input id="fave1" name="fave1">
               </label>
            </p> 
            <p>
               <label for="fave2">
                  #2: 
                  <input id="fave2" name="fave2">
               </label>
            </p> 
            <p>
               <label for="fave3">
                  #3: 
                  <input id="fave3" name="fave3">
               </label>
            </p> 
         </fieldset> 
         <button>Submit Vote</button> 
      </form>  
   </body>
</html>

Related Tutorials