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

2 posts, 0 answers
  1. Kumar
    Kumar avatar
    46 posts
    Member since:
    Sep 2010

    Posted 08 Apr 2011 Link to this post

    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.

     

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 13 Apr 2011 Link to this post

    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.

Back to Top