Problem in Retrieving text of linkbutton using Java Script
-
I want to retrieve text of link button. I am using following code but it is not working. var LblCountry =document.getElementById('" + lnktext.ClientID + "'); var ltext= LblCountry .value; when print this value using alertbox it shows as undefined Can anybody tell me how to retrieve link button value. Thanks
-
I want to retrieve text of link button. I am using following code but it is not working. var LblCountry =document.getElementById('" + lnktext.ClientID + "'); var ltext= LblCountry .value; when print this value using alertbox it shows as undefined Can anybody tell me how to retrieve link button value. Thanks
enclose lnktext.ClientID into server tags..
Abhishek Sur
%>]]>
-
enclose lnktext.ClientID into server tags..
Abhishek Sur
%>]]>
-
I want to retrieve text of link button. I am using following code but it is not working. var LblCountry =document.getElementById('" + lnktext.ClientID + "'); var ltext= LblCountry .value; when print this value using alertbox it shows as undefined Can anybody tell me how to retrieve link button value. Thanks
Hello, Using view source option of browser, Check that ClientID you are passing as argument and actual id are same.
Kiran Banker
-
Hello, Using view source option of browser, Check that ClientID you are passing as argument and actual id are same.
Kiran Banker
-
Try this document.getElementById('lnktext').value;
Kiran Banker
-
Try this document.getElementById('lnktext').value;
Kiran Banker
-
It gives following error after using the code which you suggested. document.getElementById("lnktext") has no properties
var LblCountry =document.getElementById(lnktext.ClientID); alert(LblCountry); // It will alert as object. If it is not then try to copy same id from source and check. var ltext= LblCountry .value;
Kiran Banker