473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Alert the value of a Label...

103 100+
Hi all...

I have a Label with ID "lblPrice" and a button called "btnsubmit". I would like to alert the value of the Label when clicking on the button...

Please get me the code in Javascript...

regards,
Mathew
Nov 7 '07 #1
3 1550
mathewgk80
103 100+
Hi all...

I have a Label with ID "lblPrice" and a button called "btnsubmit". I would like to alert the value of the Label when clicking on the button...

Please get me the code in Javascript...

regards,
Mathew
Hi all,
I dont get the value of lblPrice. with the javascript code as shown below.

var priceperunit=document.getElementById("ctl00_Conten tPlaceHolder1_lblPrice").value;

Please help me to alert the value of the Label 'lblPrice'..

Regards,
Mathew
Nov 7 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

could you please post the relevant code as it turns out in the browser? load the page and have a look at 'view source code' ... and post the html with the label-code ... there you should see what id the label has ... and may be this solves your problem already. otherwise we need to see what other code you use onclick of your button ... and may be that the you have to use innerHTML instead of value?

kind regards
Nov 7 '07 #3
mathewgk80
103 100+
hi ...

could you please post the relevant code as it turns out in the browser? load the page and have a look at 'view source code' ... and post the html with the label-code ... there you should see what id the label has ... and may be this solves your problem already. otherwise we need to see what other code you use onclick of your button ... and may be that the you have to use innerHTML instead of value?

kind regards

Hi,
I got the answer. as u told,i used innerhtml instead of value...

thanks...

Mathew
Nov 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: monika | last post by:
I am not clear ... whether to use alert of JavaScript or messagebox of VBScript in ASP. But what I want is that when a user has some error I want to display a pop-up kind of a thing saying "you...
8
by: simon | last post by:
hello. hopefully another quick newbie question for you.... I have a codebehind function coded to handle the click event of a button. what this function does is insert values from a data grid...
5
by: sniper | last post by:
hi ; i have this small code that consist in taking the name of the user and writing it in the same form as an output.the name is relative to /data/valid/string1 In my Js code i want to access the...
4
by: Phil | last post by:
Hi, The Alert window appears but the value is "undefined". I tried two ways What don't i see here? Thanks Phil <html xmlns="http://www.w3.org/1999/xhtml" > <head...
6
by: Phil | last post by:
Hi, This code produces an empty Alert window. No error. How to get the value into the Alert window? Thanks Phil aspx file (content page): ------------------------
10
by: MichiganMan | last post by:
This is a program to just calculate a weekly gross salary based on the hourly wage and hours worked (with overtime too). I am not getting the alert box when it calculates it. Can anyone see what I...
5
by: vjsv2007 | last post by:
Can you help to make one alert with all details? <script type="text/javascript"> <!-- function validate_form ( ) { valid = true;
4
by: ballygowanboy | last post by:
i've put this code together. there's a variable "s" giving me some grief at the mo, i'm actualy supprised it half works. it's a simple shopping cart, you pick the quantitly of items, and it...
6
by: Ahmedhussain | last post by:
Hi there, I m doing work on a gridview and Im getting an error: A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.