Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the focus on a text field 6

Status
Not open for further replies.

vilrbn

Programmer
Oct 29, 2002
105
FR
I want to set the focus on the first Text field of my form but don't know how to do as Setfocus does not exists anymore.

Thanks for your help.
 
ID, I do not have a name declared. I believe it would be passed as responsibilities As System.Web.UI.WebControls.TextBox but I could be wrong
 
Ah, actually if you set the id property in the properties view in vs.net's designer, thats the name it declares it as in teh code behind. So they shoudl be the same anyway.

If you step through your code, is the sub even being accessed when its called?

D
 
I added this responsibilites.Text = "This was fun!!!" and it was displayed in that textfield. So I would say it is running the sub, but not setting the focus.
 
Make sure that javascript isn't turned off on your machine.

Take a look at the souce of rendered page. Is the javascript there?

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
well I have javascript on the page but not any function for setting the focus.
 
RegisterStartupScript("focus", s)

Did sure you included the above bit in the code behind. The javascript should be at the bottom of you page.

do a step thru to see if s has a value in it. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top