abch624 Posted June 8, 2009 Share Posted June 8, 2009 Hi Guys, I have seen a lot of site have text in their fields when the user has not focused on that field and once they focus on it the text disapears. But when they enter their data/value then that value is dissplayed. I have googled this but dont get a proper free script. Any of you know a script I can use? Cheers - Zahid Quote Link to comment Share on other sites More sharing options...
Axeia Posted June 8, 2009 Share Posted June 8, 2009 untested guesstimate: <input type='text' value='whatever' onfocus='this.value=""' onblur='this.value == "" ? "whatever" : this.value' /> Quote Link to comment Share on other sites More sharing options...
abch624 Posted June 8, 2009 Author Share Posted June 8, 2009 I found it. http://grzegorz.frydrychowicz.net/jquery_toggleformtext/ What you provided is not what I wanted. Cheers Quote Link to comment Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Actually Axeia's code is exactly what you wanted. Working identically to the script you found Quote Link to comment Share on other sites More sharing options...
Axeia Posted June 8, 2009 Share Posted June 8, 2009 Indeed, would be advisable to use as well unless you already included jquery on the same page for other purposes as adding a big lib for something that simple just adds weight for no good reason. Quote Link to comment Share on other sites More sharing options...
abch624 Posted June 8, 2009 Author Share Posted June 8, 2009 I am already using Jquery heavely so doesnt affect the load. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.