Using appendTo() I've successfully gotten a text box to be added when I click an icon when I click an edit button. I'd love to be able to have the text in the text box pre-selected so that the user can just start typing without having to highlight everything to replace it. Any ideas/samples on how to do this?

Thanks.

Steve,

In the old days, IE had a rather convoluted way to do this while Netscape (iirc) was incapable, but now there's a much friendlier way.

After creating DOM element myTextbox and populating it with your text :

myTextbox.focus();
myTextbox.select();

I'm not sure if this is 100% universal but the major browsers seem to support it (IE, FF, Opera). WebTV is always an unknown quantity. You may therefore like to wrap these statements in a safety clause.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.