Welcome Guest Search | Active Topics | Sign In | Register

Select All Text by Clicking on Text Field Options
Red mist
Posted: Thursday, February 10, 2011 2:13:01 PM
Rank: Newbie
Groups: Member

Joined: 1/28/2011
Posts: 6
Hi,

I was trying to do the following thing on my grid: http://javascript-array.com/scripts/onclick_select_all_text_in_field/

I put the JavaScript function in the ClientSideBeginEdit tag.
But all I get is "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."

Appreciate any help!

Cheers.


eo_support
Posted: Thursday, February 10, 2011 3:14:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to delay the call with setTimeout:

Code: JavaScript
setTimeout(function()
{
    .....whatever you were doing....
}, 100);


You can not focus the textbox inside ClientSideBeginEdit because at that moment the textbox is not being displayed yet. However if you use setTimeout to display that, then by the time your code is called, the textbox is already displayed.

Thanks!
Red mist
Posted: Friday, February 11, 2011 4:54:46 AM
Rank: Newbie
Groups: Member

Joined: 1/28/2011
Posts: 6
works perfect!!

Many thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.