By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,807 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

Required Field Validator and Focus Question

P: n/a
I have some required field validators on a form and would like to know if
there is a way to set focus back to the field that is required if the
validator is triggered. The problem is that the validator is triggered and
displays the error message, but it may be up the form so far and out of
sight so the user never sees it unless he/she scrolls back up the page. I
know there is a validation summary, but it would be nice to have it set
focus back to the field so that the form automatically scrolled to the
correct position. Any way of doing this?

Thanks in advance!
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You'd have to write your own javascript for this. In ASP.NET 2.0 they can
emit this for you automatically.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have some required field validators on a form and would like to know
if there is a way to set focus back to the field that is required if
the validator is triggered. The problem is that the validator is
triggered and displays the error message, but it may be up the form so
far and out of sight so the user never sees it unless he/she scrolls
back up the page. I know there is a validation summary, but it would
be nice to have it set focus back to the field so that the form
automatically scrolled to the correct position. Any way of doing this?

Thanks in advance!


Nov 19 '05 #2

P: n/a
Thanks Brock! That's what I thought. I am looking forward to ASP.NET 2.0 for
that reason and many others. I just got back from ASP.NET Connections in
Orlando a couple of weeks ago and the things that they showed us during the
conference blew me away!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:49**********************@msnews.microsoft.com ...
You'd have to write your own javascript for this. In ASP.NET 2.0 they can
emit this for you automatically.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have some required field validators on a form and would like to know
if there is a way to set focus back to the field that is required if
the validator is triggered. The problem is that the validator is
triggered and displays the error message, but it may be up the form so
far and out of sight so the user never sees it unless he/she scrolls
back up the page. I know there is a validation summary, but it would
be nice to have it set focus back to the field so that the form
automatically scrolled to the correct position. Any way of doing this?

Thanks in advance!


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.