[jQuery] Re: Using jQuery to select text

2007-05-18 Thread Jörn Zaefferer
Robert, I'd like to prefill a text box in a form with a typical value, but select the text, so that if the user begins typing, the prefilled text is overwritten, wihtout him having to erase it. (Just like the location bar in my browser - if I click on it, the text becomes selected, so that one

[jQuery] Re: Using jQuery to select text

2007-05-18 Thread Emil Ivanov
I don't it possible neither in JS. You can make it like this: catch the onclick event and erase the text, or maybe the onkeypress event... $('#textbox').keypress(function () { if ($(this).val() == 'default text') $(this).val(''); }); You can disable the submit button like this: $('#submitBu

[jQuery] Re: Using jQuery to select text

2007-05-18 Thread S. Robert James
Is this just impossible to do? On May 18, 2:21 pm, "S. Robert James" <[EMAIL PROTECTED]> wrote: > I'd like to prefill a text box in a form with a typical value, but > select the text, so that if the user begins typing, the prefilled text > is overwritten, wihtout him having to erase it. (Just li