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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting focus after Required Field Validation

Status
Not open for further replies.

juliaroberts

Programmer
Apr 13, 2000
58
US
HI,

I am using a required field validator component on a textbox. I have enabled client side script. Is there any way to set the focus on a particular text field after client side validation fails?
 
I'm not sure if you can do what you're asking with just the requiredfieldvalidator. You may want to look at using the custom validator control instead.

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
you could try to determine what vaildator failed then use a javascript that focuses the field:

Response.Write("<script language='JavaScript'>document.getElementById('" + fieldToFocus.UniqueId + "').Focus()</script>")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top