textbox

J

JD

I have an asp.net form with a text box on it and I also have a label
control. What I want to do is when the textbox has focus I want the label
control to be enabled and populate with some tips on what goes in to the
text box. I am using vb.net and I don't see any event that will allow me to
do what I want, and I was wondering if anyone had any ideas on how to do
this. Thanks.
 
C

Cactus Corp.

I have an asp.net form with a text box on it and I also have a label
control. What I want to do is when the textbox has focus I want the label
control to be enabled and populate with some tips on what goes in to the
text box. I am using vb.net and I don't see any event that will allow me to
do what I want, and I was wondering if anyone had any ideas on how to do
this. Thanks.

Hello there,

You must add an 'onchange' attribute programmaticaly:

tb.Attributes.Add("onchange", lbl.UniqueID & ".value='hello there!';");


Antonio
 
E

Eliyahu Goldin

It's a client-side task. A label renders as a <span> and a textbox does as
an <input type=text>.You need to catch the input's onfocus event and set
the span's innerText to the inbox's "title" property.

Eliyahu
 
J

JD

could you give me some code example on the span innertext and is that cross
browser
Eliyahu Goldin said:
It's a client-side task. A label renders as a <span> and a textbox does as
an <input type=text>.You need to catch the input's onfocus event and set
the span's innerText to the inbox's "title" property.

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top