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

How to get labe value using Java Script?

2 Answers 71 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
D.SRINIVASA
Top achievements
Rank 2
D.SRINIVASA asked on 13 Jun 2011, 01:42 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Jun 2011, 02:40 PM
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.
0
D.SRINIVASA
Top achievements
Rank 2
answered on 14 Jun 2011, 08:31 AM
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  
Tags
ComboBox
Asked by
D.SRINIVASA
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
D.SRINIVASA
Top achievements
Rank 2
Share this question
or