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

How to get javascript 'value' property for custom textbox control

1 Answer 86 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kumar
Top achievements
Rank 1
Kumar asked on 08 Apr 2011, 01:27 PM

Hi
I'm creating a composite control (say name MyTextBox) which will contains child controls as RadMasked TextBox or Asp.Net TextBox and Button . And then I placed this control in a Demp Page called Defaul.aspx. And I would like to access the text entered in the  MytextBox through javascript as

 

 

document.getElementById(

 

'<%=MyTextBox1.ClientID %>').value.
which is not working because When a compiste control renders, child controls will be wrapped by SPAN element by-default. So How can I access 'value' property from javascript.

 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 Apr 2011, 03:04 PM
Hi Kumar,

Try using the following:
function TestAccess()
{
alert(document.getElementById("cCompCtrl").innerHTML);
}


Regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Input
Asked by
Kumar
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or