textbox

  • Thread starter Thread starter JD
  • Start date Start date
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.
 
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
 
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
 
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

Back
Top