I have done that , but it is no effect
My code is:
protected void Page_Load(object sender, EventArgs e)
{
TextBox3.Attributes["onfocus"] = "this.selected()";
}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox3.Focus();
}
But after I click Button1, the text in TextBox3 is not selected.
"Eliyahu Goldin" <re*************@monarchmed.com> ¼¶¼g©ó¶l¥ó·s»D
:#T**************@TK2MSFTNGP15.phx.gbl...
TextBox renders as <input type=text ...>. This element has a method
select(). Setup a client-side onfocus event like this (c# syntax):
myTextBox.Attributes["onfocus"]="this.selected()";
Eliyahu
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl... I want the text in a TextBox selected when the TextBox get focus.
How can I do that?