473,322 Members | 1,401 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,322 software developers and data experts.

Setting the Value of a Label with Javascript

How can a value be set to a label in javascript.

I can set values to <h6> tags, but I need to set the value of a label. Particularly becasue I can't seem to acces the value of an <h6> tag in the aspx.vb code-behind on the aspx page.

So far I got the changing of <h6> values working by doing this:

Expand|Select|Wrap|Line Numbers
  1. function SellLots_DoFSCommand(command, args){
  2.                         if(args != "" && args != null)
  3.                         {
  4.                             document.getElementById("Selection").innerHTML = "Lot#" + command + " is currently " + args;
  5.                             document.getElementById("Status").innerHTML = args;
  6.                             document.getElementById("LotId").innerHTML = command;          
  7.                         }
Unfortunatly, that doesn't help me, so I need to set the value of an <asp:label> so I can access it.

I've already tried the following and it doesn't set the value of the label "label2":

Expand|Select|Wrap|Line Numbers
  1. function SellLots_DoFSCommand(command, args){
  2.                         if(args != "" && args != null)
  3.                         {
  4.                             document.getElementById("Selection").innerHTML = "Lot#" + command + " is currently " + args;
  5.                             document.getElementById("Status").innerHTML = args; 
  6.                             document.getElementById("LotId").innerHTML = command;  
  7.                             document.getElementById("label2").innerText = "Hello!";         
  8.                         }
It works with all of the <h6> as before, but the last one (label2) is the one I can't seem to figure out how to set the value of.

I'd appreciate any help that anyone might be able to offer!
Nov 10 '07 #1
1 2223
acoder
16,027 Expert Mod 8TB
Look at the source (in the browser) and see what the ID of the <asp:label> is and use that.
Nov 10 '07 #2

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

Similar topics

12
by: daniel kaplan | last post by:
Hi All, Been learning Javascript (via google) to create forms with pre-set values. As seen below. My problem I have found is this: I can't seem to figure out (or find so far via google) how to...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
1
by: Mike | last post by:
Hi, I am developing a JavaScript calendar control. I want my user control to expose a property that returns the value of the selected calendar date. I have an "input" control that displays the...
2
by: jason | last post by:
Hello and Good Day. REALLY LOST. Running ASP.NET 1.1 Becuase I think I'm using my own controls smartnavigation does not appear to work for me. Stardard issue: I've got a datagrid thats...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.