Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > setfocus and select text in a textbox

Reply
Thread Tools

setfocus and select text in a textbox

 
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      04-12-2006
hi all,

I have a webform that I would like do add some features.
How do I :
1) setfocus in a textbox when the page first loads up; and also dynamically
when I want to focus on it.
2) highlight the text in a textbox.

TIA.
regards,
andrew
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Y2xpY2tvbg==?=
Guest
Posts: n/a
 
      04-12-2006
I don't know how to highlight the text in a text box but to set the focus on
it you just call the focus method. e.g. MyTextBox.Focus();

"Andrew" wrote:

> hi all,
>
> I have a webform that I would like do add some features.
> How do I :
> 1) setfocus in a textbox when the page first loads up; and also dynamically
> when I want to focus on it.
> 2) highlight the text in a textbox.
>
> TIA.
> regards,
> andrew

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      04-12-2006
i am refering to a webform on asp.net 1.1. I don't think there is a focus()
for a textbox server control.

"clickon" wrote:

> I don't know how to highlight the text in a text box but to set the focus on
> it you just call the focus method. e.g. MyTextBox.Focus();
>
> "Andrew" wrote:
>
> > hi all,
> >
> > I have a webform that I would like do add some features.
> > How do I :
> > 1) setfocus in a textbox when the page first loads up; and also dynamically
> > when I want to focus on it.
> > 2) highlight the text in a textbox.
> >
> > TIA.
> > regards,
> > andrew

 
Reply With Quote
 
=?Utf-8?B?Y2xpY2tvbg==?=
Guest
Posts: n/a
 
      04-12-2006
oh right, there is in ASP.net 2.0, i didn't realise it was a new method.

"Andrew" wrote:

> i am refering to a webform on asp.net 1.1. I don't think there is a focus()
> for a textbox server control.
>
> "clickon" wrote:
>
> > I don't know how to highlight the text in a text box but to set the focus on
> > it you just call the focus method. e.g. MyTextBox.Focus();
> >
> > "Andrew" wrote:
> >
> > > hi all,
> > >
> > > I have a webform that I would like do add some features.
> > > How do I :
> > > 1) setfocus in a textbox when the page first loads up; and also dynamically
> > > when I want to focus on it.
> > > 2) highlight the text in a textbox.
> > >
> > > TIA.
> > > regards,
> > > andrew

 
Reply With Quote
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      04-12-2006
anyone else able to assist me. all suggestions are welcomed.

"clickon" wrote:

> oh right, there is in ASP.net 2.0, i didn't realise it was a new method.
>
> "Andrew" wrote:
>
> > i am refering to a webform on asp.net 1.1. I don't think there is a focus()
> > for a textbox server control.
> >
> > "clickon" wrote:
> >
> > > I don't know how to highlight the text in a text box but to set the focus on
> > > it you just call the focus method. e.g. MyTextBox.Focus();
> > >
> > > "Andrew" wrote:
> > >
> > > > hi all,
> > > >
> > > > I have a webform that I would like do add some features.
> > > > How do I :
> > > > 1) setfocus in a textbox when the page first loads up; and also dynamically
> > > > when I want to focus on it.
> > > > 2) highlight the text in a textbox.
> > > >
> > > > TIA.
> > > > regards,
> > > > andrew

 
Reply With Quote
 
rashidpervaiz@gmail.com rashidpervaiz@gmail.com is offline
Junior Member
Join Date: Jun 2007
Posts: 1
 
      06-11-2007
Use this one.
txtbox1.Focus();
txtbox1.Attributes.Add("onfocusin", " select();");
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to clear server side textbox with setfocus event? john22 ASP .Net 0 11-06-2007 03:22 PM
setfocus textbox niv ASP .Net Web Controls 0 10-19-2004 02:36 AM
setfocus on mobile textbox for barcode scanning Robin Prosch via .NET 247 ASP .Net Mobile 0 07-03-2004 02:56 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM
asp setfocus and performance jamess ASP .Net 1 10-30-2003 03:26 AM



Advertisments