473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Required Field Validator and Focus Question

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
2 2240
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: nntp-service.ohio-state.edu | last post by:
Hey folks - I'm a newbie to java script. I'm trying to make a portable data-validator for fields in an HTML form. Ideally, it would work something like this: <input type="text" name="test"...
5
by: Dave Brydon | last post by:
I'm checking for required fields, and using the code below, which I normally have no difficulties with; however, as a twist I decided to return the focus back to the specific field(s) in question...
2
by: bufbec1 | last post by:
I am pretty good with Access, but do not understand VBA. I have researched this topic and see only VBA answers, so I hope someone can help with my specific question. I have 2 fields for an...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
2
by: Martin | last post by:
Dear Group It says in MSDN that a field can be associated with more than one validators but can one validator be associated with more than one field? Or do I need a validator for each field? How...
2
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
3
by: Skeptical | last post by:
Hello, I have a form and two buttons on it. Button1 submits the data to a database and RequiredFieldValidator is used to make sure all the required fields are filled up, the second button has a...
3
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
0
by: sinureddy | last post by:
I am working on ASP.Net2.0 I have a TextBox, a associated RequiredFieldValidator and a LookupButton. I do have a Save Button. Without entering anything in TextBox I clicked Save Button....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.