[jQuery] Re: looking for plugin that presets values in text box
How about just using tooltips (or clueTips), instead of all that custom code for each field? You could even attach the tooltip on a little icon or question mark next to each field. Larry Kevin Scholl wrote: The plugin toggleVal (written by a colleague of mine) might be of some interest to you. http://plugins.jquery.com/project/toggleval On Jan 5, 11:45 pm, Bhaarat Sharma [EMAIL PROTECTED] wrote: Hi, some time ago I saw a jquery plugin which would preset the value in a text box and when users' cursor came to that text box...the preset value would go away. it was sort of there to let the user know what format should be in this text field. I cant recall the name of the plugin. Wondering if someone can help me find this plugin?
[jQuery] Re: looking for plugin that presets values in text box
$('input').focus(function() { $(this).val(null); }); On Jan 5, 2008 8:45 PM, Bhaarat Sharma [EMAIL PROTECTED] wrote: Hi, some time ago I saw a jquery plugin which would preset the value in a text box and when users' cursor came to that text box...the preset value would go away. it was sort of there to let the user know what format should be in this text field. I cant recall the name of the plugin. Wondering if someone can help me find this plugin? -- http://morglog.alleycatracing.com Lets make up more accronyms! http://www.alleycatracing.com LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike nerdity.
[jQuery] Re: looking for plugin that presets values in text box
On Jan 5, 11:45 pm, Bhaarat Sharma [EMAIL PROTECTED] wrote: Hi, some time ago I saw a jquery plugin which would preset the value in a text box and when users' cursor came to that text box...the preset value would go away. it was sort of there to let the user know what format should be in this text field. you don't need any plugin, jQuery can handle it directly: $('form#myform [EMAIL PROTECTED]').val('please enter here').click(function() { if (this.value == 'please enter here') this.value = ''; }); lihao(XC)
[jQuery] Re: looking for plugin that presets values in text box
$('form#myform [EMAIL PROTECTED]').val('please enter here').click(function() { if (this.value == 'please enter here') this.value = ''; }); The downside to changing the value attribute is that the please enter here text will be submitted with the form if the user doesn't enter any value before submitting. You can use some validation javascript to look for the values and display an error message. Or, you could use something like the overlabel plugin, which places the prompt above the form element without changing the value. http://scott.sauyet.com/thoughts/archives/2007/03/31/overlabel-with-jquery/
[jQuery] Re: looking for plugin that presets values in text box
On Jan 6, 11:00 am, Dave Methvin [EMAIL PROTECTED] wrote: $('form#myform [EMAIL PROTECTED]').val('please enter here').click(function() { if (this.value == 'please enter here') this.value = ''; }); The downside to changing the value attribute is that the please enter here text will be submitted with the form if the user doesn't enter any value before submitting. You can use some validation javascript to look for the values and display an error message. Or, you could use something like the overlabel plugin, which places the prompt above the form element without changing the value. Right, but I prefer to handle this directly in jQuery. :-) var $myform = $('form#myform'); var $myinput = $('[EMAIL PROTECTED]', $myform); $myinput.val('please enter here').click(function() { if (this.value == 'please enter here') this.value = ''; }) $myform.submit(function() { if ($myinput.val() == 'please enter here' || $myinput.val() == '') { alert('please enter something'); return false; } }); lihao(XC)
[jQuery] Re: looking for plugin that presets values in text box
The plugin toggleVal (written by a colleague of mine) might be of some interest to you. http://plugins.jquery.com/project/toggleval On Jan 5, 11:45 pm, Bhaarat Sharma [EMAIL PROTECTED] wrote: Hi, some time ago I saw a jquery plugin which would preset the value in a text box and when users' cursor came to that text box...the preset value would go away. it was sort of there to let the user know what format should be in this text field. I cant recall the name of the plugin. Wondering if someone can help me find this plugin?