I want to make a hint when user clicked in textbox. The hint message will display outside the textbox.
Where can I find related script?
Or could anyone can help me?
I want to make a hint when user clicked in textbox. The hint message will display outside the textbox.
Where can I find related script?
Or could anyone can help me?
You can do this easily with just CSS;
Code:.tip { display:inline-block; position:fixed; z-index:999; padding:0.5em 1em; width:10em; background:yellow; border:1px solid black; opacity:0 } .text:focus + .tip { -webkit-animation:fadeIn 1s both; animation:fadeIn 1s both } @-webkit-keyframes fadeIn { 0% { opacity:0 } 100% { opacity:1 } } @keyframes fadeIn { 0% { opacity:0 } 100% { opacity:1 } }This will work in IE9+ and modern browsers.Code:First name: <input type="text" class="text" name="fname"><div class="tip">Please enter your first name here.</div><br/> Last name: <input type="text" class="text" name="lname"><div class="tip">Please enter your last name here.</div>
If you need IE8 support, just use a conditional stylesheet to set .tip asdisplay:none;in it's default state, changing todisplay:inline-block;on focus.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
I don't have an Android device to test on at the moment but it works as expected in my tests here on iPhone - the tip boxes vanish as soon as the text field loses focus. At no point do multiple boxes show - only one per focussed form field.
Please post a link to your page so I can see how you've set it up.
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
Bookmarks