4

I have a very long php form which is used to save input values entered by users. I want to show hints next to the input boxes. I know this HTML input field hint but this is not my goal, i want to show it next to the input boxes which will appear/disappear when ever user selects the respective field. (i want this in html not in javascript etc because i do not know JavaScript.)

Community
  • 1
  • 1
ayan khan
  • 83
  • 1
  • 1
  • 6

4 Answers4

17

You should use HTML5 and use textfields like

<input type="text" placeholder="enter input" title="Enter input here">

nsthethunderbolt
  • 2,059
  • 1
  • 17
  • 24
9

You can do it with the :focus CSS pseudo-class. Put a span next to the input box and give it this style:

.hint { display: none; }
input:focus + .hint { display: inline; }

JSBin: http://jsbin.com/inilot/1/edit

Tom Smilack
  • 2,057
  • 15
  • 20
7

You can use title argument like this :

<input title="hint" ... />

TN888
  • 7,659
  • 9
  • 48
  • 84
5

This is a CSS technique without using any Java{script} code:

<style>
.ami div {display:none}
.ami:hover div {display:block}
</style>
<a class=ami href="#">Please hover me <div>I show only when you over</div></a>
</html>

Hope I Help

Aminadav Glickshtein
  • 23,232
  • 12
  • 77
  • 117