Hi
On a webpage I fill some text from a database in a textbox.
Now I should "select all" the text in that textbox by code; like the user can do this using the context menu.
This site is written in VB.NET and I got the hint doing this clientside by javascript:
javascript:this.form.text_area.focus();this.form.text_area.select();
I tried this in the VB-Code:
'TextBox1.Attributes.Add("onLoad", "this.form.TextBox1.select();")
also in the aspx-Source:
<asp:textbox id="TextBox1" runat="server" Width="120px" OnLoad="javascript:select();"></asp:textbox>
Both do not work.
I'm new in javascript.
Anyone knows how to do this?
Thanks
Lelo
On a webpage I fill some text from a database in a textbox.
Now I should "select all" the text in that textbox by code; like the user can do this using the context menu.
This site is written in VB.NET and I got the hint doing this clientside by javascript:
javascript:this.form.text_area.focus();this.form.text_area.select();
I tried this in the VB-Code:
'TextBox1.Attributes.Add("onLoad", "this.form.TextBox1.select();")
also in the aspx-Source:
<asp:textbox id="TextBox1" runat="server" Width="120px" OnLoad="javascript:select();"></asp:textbox>
Both do not work.
I'm new in javascript.
Anyone knows how to do this?
Thanks
Lelo