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 Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/ 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' /> Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/#findComment-851768 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 Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/#findComment-851769 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 Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/#findComment-851771 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. Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/#findComment-851874 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. Link to comment https://forums.phpfreaks.com/topic/161405-solved-onbluronhover-text-field-value/#findComment-851876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.