Making Validation Summary visible

D

daveh551

I have a web page with an address entry form and some other things on
it. The form has field validators on several of the fields, and a
validation summary at the bottom. Because of the size of the form, on
a typical screen, you need to scroll to see the bottom of the form,
which is where the validation summary is. So when a user presses
submit, and gets a validation error, the screen redisplays, but it
redisplays from the top with (typically) the error messages below the
bottom, and the naive user is going to say "What the heck, why did it
bring me back here again".

I've tried unsuccessfully to have it redisplay with the screen
scrolled up so the bottom portion is in view. I'm sure this can be
done, probably relatively easily. Can someone give me some pointers on
how (aside from moving the validation summary to the top of the
screen!).

Thanks.
 
G

Gregory A. Beamer \(Cowboy\) - MVP

The position of the form in the browser is partially dictated by you and
partially by the user. I do not have the specifics, but newer browsers allow
a particular position to be saved (where a user has scrolled). This may or
may not be useful. If so, it is a simple setting. I don't have it in front
of me right now and don't remember what it is called. It is a setting in the
browser that you can tell the browser to use from your code. I am also not
sure it will work.

One option is to set up an anchor tag where the validation summary will go
and use JavaScript to scroll to that anchor. A bit more work to "debug" as
you have client and server side to contend with, but it will work.

I would seriously conside the validation summary at the top or move away
from summary and use CSS to change colors of the elements that are
incorrect, with proper tags to create hovers for the mistakes. I think it
makes a much prettier design. if you opt this direction, you can still have
summary at the bottom, but it is not really necessary, as the user can see
everything that is wrong as he goes through the form.

NOTE: The above pattern is a bit of work, unless you create your own custom
validation object to work from.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top