473,372 Members | 1,095 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,372 software developers and data experts.

focus on control after an error

Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.

Aug 8 '06 #1
7 1545
Set the SetFocusOnError portery of the validator control. if you have client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent text
box.

"saurabh" wrote:
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.

Aug 8 '06 #2
If using ASP.NET 2.0, use SetFocusOnError...

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:56**********************************@microsof t.com...
Set the SetFocusOnError portery of the validator control. if you have
client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent text
box.

"saurabh" wrote:
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.

Aug 8 '06 #3
I am using 1.1.4322 and couldnt find any property like that :( Tell me
is there any workaround ?
what if more than two controls have error. Which control will have the
focus?? in my case i want 5th control to get focus.(basically the
control which is above all other controls having error)

Siva M wrote:
If using ASP.NET 2.0, use SetFocusOnError...

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:56**********************************@microsof t.com...
Set the SetFocusOnError portery of the validator control. if you have
client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent text
box.

"saurabh" wrote:
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.
Aug 8 '06 #4
Sorry i forgot it's a .net 2.0 thing.

"saurabh" wrote:
I am using 1.1.4322 and couldnt find any property like that :( Tell me
is there any workaround ?
what if more than two controls have error. Which control will have the
focus?? in my case i want 5th control to get focus.(basically the
control which is above all other controls having error)

Siva M wrote:
If using ASP.NET 2.0, use SetFocusOnError...

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:56**********************************@microsof t.com...
Set the SetFocusOnError portery of the validator control. if you have
client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent text
box.

"saurabh" wrote:
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.
>
>

Aug 8 '06 #5
asp.net 1.1 does not provide this functionality..To do this, you have to
write your own javascript code.

"saurabh" <sa********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
>I am using 1.1.4322 and couldnt find any property like that :( Tell me
is there any workaround ?
what if more than two controls have error. Which control will have the
focus?? in my case i want 5th control to get focus.(basically the
control which is above all other controls having error)

Siva M wrote:
>If using ASP.NET 2.0, use SetFocusOnError...

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:56**********************************@microso ft.com...
Set the SetFocusOnError portery of the validator control. if you have
client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent
text
box.

"saurabh" wrote:
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.


Aug 9 '06 #6
ohh and any idea how to do that in java script ???or any other
workaround exist ?

Kumar Reddi wrote:
asp.net 1.1 does not provide this functionality..To do this, you have to
write your own javascript code.

"saurabh" <sa********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
I am using 1.1.4322 and couldnt find any property like that :( Tell me
is there any workaround ?
what if more than two controls have error. Which control will have the
focus?? in my case i want 5th control to get focus.(basically the
control which is above all other controls having error)

Siva M wrote:
If using ASP.NET 2.0, use SetFocusOnError...

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:56**********************************@microsof t.com...
Set the SetFocusOnError portery of the validator control. if you have
client
side validation enabled as soon as the user moves out of the textbox, if
there is an error, the focus will immedietly move back to the relevent
text
box.

"saurabh" wrote:

Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.
Aug 9 '06 #7
If you are using ValidationSummary control to list the error
messages..I will give you a hint, how you can approach the problem..

If you open WebUIValidation.js file, you would see
"ValidationSummaryOnSubmit" function. This function determines if the
page is valid or not.. then if the page is not valid.. it will iterate
through all the invalid validators on the page and get the error
messages from them and list them in a bulleted format or other
according to the way you customize it.. So, you should be able to get
the ID's of all the invalid validator controls from this method.. so
see if you can solve your problem from there..

saurabh wrote:
ohh and any idea how to do that in java script ???or any other
workaround exist ?

Kumar Reddi wrote:
asp.net 1.1 does not provide this functionality..To do this, you have to
write your own javascript code.

"saurabh" <sa********@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
>I am using 1.1.4322 and couldnt find any property like that :( Tell me
is there any workaround ?
what if more than two controls have error. Which control will have the
focus?? in my case i want 5th control to get focus.(basically the
control which is above all other controls having error)
>
Siva M wrote:
>If using ASP.NET 2.0, use SetFocusOnError...
>>
>"clickon" <cl*****@discussions.microsoft.comwrote in message
>news:56**********************************@microso ft.com...
>Set the SetFocusOnError portery of the validator control. if you have
>client
>side validation enabled as soon as the user moves out of the textbox, if
>there is an error, the focus will immedietly move back to the relevent
>text
>box.
>>
>"saurabh" wrote:
>>
Hey,
I have a form in which there are say 10 fields. I am using validator
control for all the fields. suppose user forgets to fill field no. 5, 8
, 9 and 10.
So on clicking the save button,obviously an error willl be raised. Is
there anyway such that when the error is raised the focus goes to
first control that has false validation (e.g in our case that control
is 5) ? Right now after clicking the save button, none of the control
has the focus.
>
>
>
Aug 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike Hnatt | last post by:
I'd like the focus to be on "mycontrol" when the page is first loaded. I'm getting an undefined error and am assuming that I can't do this in the body ONLOAD event because the control is not yet...
4
by: Nitin | last post by:
Hi I have created function to check date and time. at the time of execution, if date is left empty the function returns the error message but then the focus goes to next field. Next filed is for...
3
by: Dave | last post by:
We are developing a web page that shows large graphics. To provide more screen space for the graphics, we allow the user to popup a window that places itself over the top part of the browser. This...
0
by: ED M. | last post by:
Hello all...I'm new to the board. I have a problem that I hope someone here might be able to solve for me. I am doing some clientside validation using Javascript. The text I am testing is...
2
by: James | last post by:
Hi I have set up a subform in datasheet mode containing a second subform also in datasheet mode in order to be able to open it as a subdatasheet. In my application I make the first subform...
18
by: Euphor2 | last post by:
I'm in school, taking a VB .NET 2003 course, and the teacher taught us how to use Sender.Focus() to return focus to the control from which focus was received. However, when I got home, and tried...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers for...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.