Discussion:
Problem with Form.ValidateChildren (infinite validation loop?)
(too old to reply)
jheimberger
2007-05-15 20:33:03 UTC
Permalink
When attempting to use the form.ValidateChildren() with multiple validation
errors the code appears to get in an infinite loop among the various
validation subroutines. With only one validation error on the form the
problem does not appear to occur. Thank you for your help on this issue.
--
Jeffrey A Heimberger, MCP
Information Systems Assistant
Stark Area Regional Transit Authority (SARTA)
Ph. 330-454-6132 x 526 -- fax 330-454-5476
Voted #1 Transit in America
jheimberger
2007-05-15 20:35:01 UTC
Permalink
In addition, this loop freezes the application
Ken Halter
2007-05-15 20:53:15 UTC
Permalink
Post by jheimberger
When attempting to use the form.ValidateChildren() with multiple validation
errors the code appears to get in an infinite loop among the various
validation subroutines. With only one validation error on the form the
problem does not appear to occur. Thank you for your help on this issue.
What language? ValidateChildren? If this is dotNet related, you'll want to
post to a dotNet group. They all contain "dotnet" in their names.
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
jheimberger
2007-05-16 13:43:01 UTC
Permalink
I have isolated and understand the problem. When an error is found during
validation I set the focus to the bad field. As an example the focus is set
to the phone number and then when a second error is found during validation I
then set the focus to that field. The problem occurs because the last
field (phone number) has a ‘lost focus’ event which is triggered and the
event is handled calling the lost focus event and even calling the validation
event for this phone number field. I eliminated more than one set focus
command during the validation task.
--
Jeffrey A Heimberger, MCP
Information Systems Assistant
Stark Area Regional Transit Authority (SARTA)
Ph. 330-454-6132 x 526 -- fax 330-454-5476
Voted #1 Transit in America
Loading...