label.text refresh

M

maria

Hi
I hope some one can help me

I have a table of type <asp:Table>. This table is filled
in runtime with labels and textboxes(also server
controls). I have written a function i jscript since when
a user leaves on of the textbox I want to update a labels
text. The problem is to refresh that text. some sample
code: In the html-page
<script language="jscript">
function test(txtId, txtText)
{
var lbl,i, txt1, txt2,val;
if (txtId=="txt")
{
txt1=document.body.getElementsByTagName("test");
lbl1=document.body.getElementsByTagName("lbl1");
lbl1.Text= 'test';
alert(lbl1.Text);
}
}
</script>

I know I get the right things in the alert. So how do i
refresh just one specific label thats in a tablecell, any
suggestions?

/Maria
 
B

Bin Song

Hi, Maria

ASP:Label is rendered as html span and ASP:TextBox is
rendered as input textbox or Textarea in client side. So
in client side, you could access its text by value or
innerText property.
Like:
lbl1.innerText = txt1.value;

Bin Song, MCP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top