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.



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]