[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread Karl Swedberg
well, mine isn't really a public plugin. but it made sense to write it as a plugin for myself so I could use it easily in multiple projects. Feel free to use anything you want in it, though, for jQuery UI Forms. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread Jörn Zaefferer
Another one, with, despite its name, support for password fields (by cloning the field and displaying a normal input while not focused): Demo: http://dev.jquery.com/view/trunk/plugins/searchField/ Source: http://dev.jquery.com/view/trunk/plugins/searchField/jquery.searchField.js Usage: $("input"

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread Jörn Zaefferer
I mean, what the hell, at least 6 plugins for such a basic feature?? Jörn On Fri, Jul 18, 2008 at 5:56 PM, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > Another one, with, despite its name, support for password fields (by > cloning the field and displaying a normal input while not focused): > > De

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread Karl Swedberg
I really like this approach, Scott! The advantage it has is that it plays nicely with form validation. Not an issue with a simple search field, but for larger forms in which the fields need to be empty unless user enters text, the other approach could foil validating on required fields beca

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread nood
I wrote one a week ago. As well as adding adn removing the titles it adds and removes extra CSS classes so you can change the way it is displayed. Usage: $('#contactform').inputAutoTitles(); in your forms use jQuery.fn.extend({ inputAutoTitles: function(options) { // st

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-18 Thread Michael Schwarz
Hi, I did this here: /* get default value of any and make it disappear when the user focusses the input field when the focus is taken from that field (blur), do this: if nothing was entered by the user, set back the default value, otherwise don't mess with the users input */ $('input').focus

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-17 Thread Scott Sauyet
Andy Matthews wrote: Is there a plugin for this by chance? I know it's pretty quick to write, but wanted to find out if someone's already done it better than I could. Also, would toggle() work for this sort of thing? Is there a focus/blur toggle in the jQuery core? Something similar I did s

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-17 Thread Brandon Aaron
[mailto:[EMAIL PROTECTED] *On > Behalf Of *Brandon Aaron > *Sent:* Thursday, July 17, 2008 12:27 PM > *To:* jquery-en@googlegroups.com > *Subject:* [jQuery] Re: Input field: focus=remove text; blur=put it back > > I wrote this a while back: > http://dev.jquery.com/browser/trun

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-17 Thread Andy Matthews
field: focus=remove text; blur=put it back I wrote this a while back: http://dev.jquery.com/browser/trunk/plugins/clearonfocus/jquery.clearonfocus .js -- Brandon Aaron On Thu, Jul 17, 2008 at 11:19 AM, Andy Matthews <[EMAIL PROTECTED]> wrote: Is there a plugin for this by chance? I know

[jQuery] Re: Input field: focus=remove text; blur=put it back

2008-07-17 Thread Brandon Aaron
I wrote this a while back: http://dev.jquery.com/browser/trunk/plugins/clearonfocus/jquery.clearonfocus.js -- Brandon Aaron On Thu, Jul 17, 2008 at 11:19 AM, Andy Matthews <[EMAIL PROTECTED]> wrote: > Is there a plugin for this by chance? I know it's pretty quick to write, > but wanted to find