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.)
Asked
Active
Viewed 5.8k times
4
-
1javascript is not the same as java – jmoerdyk Jan 29 '13 at 18:36
-
1Java an Javascript are 2 totally different languages. Besides you can't change your HTML to show/hide something without Javascript. – Niels Jan 29 '13 at 18:36
4 Answers
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; }

Tom Smilack
- 2,057
- 15
- 20
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