[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Get the label name with Javascript/ASP.Net

Posted on 2007-04-04
2
Medium Priority
?
460 Views
Last Modified: 2008-02-01
This is related to the question i asked here but i closed that question:
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22490183.html

I have a label with id="lblHPhone" and text="Home Phone"
I want to get the text and tried this:
  var test = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("lblHPhone").ClientID %>');
        alert(test.value);

But I get "undefined" for that...how can I get the label name??
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
gops1 earned 2000 total points
ID: 18850640
Try

var test = document.getElementById('lblHPhone').innerHTML;
alert(test);
0
 
LVL 10

Expert Comment

by:Jaax
ID: 18850653
How is your label defined ?
Something like this:
<input type="text" name="lblHPhone" id="lblHPhone">  ?

Also ensure that there is only one element with the name lblHPhone
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question