How to get labe value using Java Script?

3 posts, 0 answers
  1. D.SRINIVASA
    D.SRINIVASA avatar
    34 posts
    Member since:
    Oct 2010

    Posted 13 Jun 2011 Link to this post

    Hi friends

    i am Srinivas

    In my project i am using RadGrid. in my RadGrid i have a Asp label for Displaying a data form Backend tables. now i want to get the value from Asp label when i am click on RadDatePicker using Java Script.

    I tried to get the Label Value in Java script like the Following Way but returns null value.

    function dateselect(sender, args) {


            var rdgrid = $find("<%=RadGrid1.ClientID %>");
            var cell = sender.get_element().parentNode.parentNode;
            var index = cell.parentNode.rowIndex;
            var MasterTable = rdgrid.get_masterTableView();
            var row = MasterTable.get_dataItems()[index - 3]; //getting row
            var textbox = document.getElementById("lot_id");
            alert(textbox);
           

    i want to get the label value in the current row.. 

    Please help me

    Thanks 

    D.Srinivasa

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Jun 2011 Link to this post

    Hello Srinivasa,

    You can access the Label control by using the findElement() method.

    Javascript:
    var row = MasterTable.get_dataItems()[index - 3];
    var chkBox = row.findElement("lot_id");

    Thanks,
    Princy.
  3. D.SRINIVASA
    D.SRINIVASA avatar
    34 posts
    Member since:
    Oct 2010

    Posted 14 Jun 2011 Link to this post

    Thanks Princy...

    This concept is very useful in another concept in my project.. Actually my problem is to get the label text using Java Script. 

    Please Help me

    Thanks 
    D.Srinivasa  
Back to Top