Share this page 

Add a visual hint to a mandatory fieldTag(s): Form


<style>
  span.mandatory { 
     background-image: url(../images/mandatory.gif);
     background-repeat: no-repeat;
     background-position: center left;
     padding-left: 0.5em;
  }
  span.nonmandatory {
     padding-left: 0.5em;
}
</style>

<label>
 <span class=mandatory>Value : </span>
 <input type=text width=50/>
</label><br>

<label>
 <span class=nonmandatory>Value : </span>
 <input type=text width=50/>
</label>


It looks like this :







See also this HowTo.