This is a migrated thread and some comments may be shown as answers.

Full ClientID

2 Answers 57 Views
Input
This is a migrated thread and some comments may be shown as answers.
benitolopez_sistemas
Top achievements
Rank 1
benitolopez_sistemas asked on 02 May 2010, 05:05 AM
Is there way I can get the full ClientID description?

I need to "focus" via javascript the webcontrols, but as you know if you have a radtextbox  the clientId "focusable" is endding with "_text", the raddateinput ends with "_dateInput_text", etc

So I need to know if there is a function for retrieving on the serverside this information.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 May 2010, 07:21 AM

Hello,

You could use the following client code in order to get the client side object of RadDateInput control.

         var input = $find('<%= RadDateInput1.ClientID %>');

.

.

The following example shows how to get a reference to its DOM element:

         var inputElement = $get('<%=RadInput1.ClientID%>' + '_text');

.

.

Checkout the documentation for more information about this: Client-Side Basics

Additionally, Here is the code that I used for focussing the RadDateInput control from client side. I hope this could help.

 
<script type="text/javascript">  
    function pageLoad() {  
        var input = $find('<%= RadDateInput1.ClientID %>');  
        input.focus();  
    }  
</script> 

-Shinu.

0
benitolopez_sistemas
Top achievements
Rank 1
answered on 03 May 2010, 11:07 PM
Thanks for reply.

But If I have a lot of radwebcontrols or webcontrols in the page, and I need serverside generate the client javascript code, How can I know on ther serverside the full clientid of the webcontrol for passing it as a parameter, and send it back the javascript code to the browser ?

In your example you refer just for one webcontrol, but I need a function to pass a full clientid as parameter for any webcontrol on the page.

Thanks
Tags
Input
Asked by
benitolopez_sistemas
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
benitolopez_sistemas
Top achievements
Rank 1
Share this question
or