Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display hints in html form fields? [closed]

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.)

like image 368
ayan khan Avatar asked Nov 28 '22 01:11

ayan khan


2 Answers

You should use HTML5 and use textfields like

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

like image 63
nsthethunderbolt Avatar answered Dec 09 '22 17:12

nsthethunderbolt


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

like image 44
Tom Smilack Avatar answered Dec 09 '22 19:12

Tom Smilack