label.text refresh

  • Thread starter Thread starter maria
  • Start date Start date
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
 
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
 
Back
Top