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.
J. D.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
"JD" <jdnews@.dalys.us> wrote in message
news:ueb6sxOmFHA.3656@.TK2MSFTNGP09.phx.gbl...
> 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.
> --
> J. D.
>
> 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 t
o
> do what I want, and I was wondering if anyone had any ideas on how to do
> this. Thanks.
> --
> J. D.
Hello there,
You must add an 'onchange' attribute programmaticaly:
tb.Attributes.Add("onchange", lbl.UniqueID & ".value='hello there!';");
Antonio
could you give me some code example on the span innertext and is that cross
browser
"Eliyahu Goldin" <removemeegoldin@.monarchmed.com> wrote in message
news:%23Cn1C6OmFHA.1416@.TK2MSFTNGP09.phx.gbl...
> 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
> "JD" <jdnews@.dalys.us> wrote in message
> news:ueb6sxOmFHA.3656@.TK2MSFTNGP09.phx.gbl...
> to
>
In addition to the solutions posted by Eliyahu and Cactus, you can also
design your customized databound control if the tips for each text box are
saved in a database. This is a sample for such databound control:
http://www.societopia.net/Samples/textBox.aspx
Or you can use client-side scripting to load xml data, as in this example:
http://www.societopia.net/Samples/textBox.htm
Phillip Williams
"JD" wrote:
> 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 t
o
> do what I want, and I was wondering if anyone had any ideas on how to do
> this. Thanks.
> --
> J. D.
>
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment