RequiredFieldValidator's Display="Dynamic" acts different when selecting from previously used entrie

N

Nathan Sokalski

When testing a form of mine which uses RequiredFieldValidators that have the
Display property set to "Dynamic" the ErrorMessage property is automatically
removed when an entry is completely typed and the user leaves the textbox.
However, if the entry is selected from the list of previously typed entries,
the error does not disappear until the page is validated using the
Page.Validate() method. I find this very weird (not to mention it may be
confusing to visitors who use the form), since selecting from the list of
previously typed entries is supposed to be the same as typing something in.
Has anyone else noticed this? Is it simply a bug that will hopefully be
fixed in a future version of the .NET Framework? Is it only a problem with
IE (I am using IE 6.0 for my testing)? I would like to avoid this problem to
prevent confusion as to what is a valid entry, but I don't want to have to
postback to the server for every field in the form. Am I missing something?
Thanks.
 
P

Peter Blum

The autocomplete feature - the list of suggestions - does not fire the
onchange event on IE. This is an unfortunate feature of IE. The onchange
event is what the validators use to fire them when a field changes.

As the author of a replacement to the Microsoft validators, I have addressed
this by creating an improved TextBox control that has some extra javascript
to detect this case and fire my validators. ("Professional Validation And
More" at http://www.peterblum.com/vam/home.aspx)

Regardless of this limitation, you should have your server side code always
validate. Its simple. Just test Page.IsValid is true in the Click post back
event method. The reason to do it on the server side: client-side validation
is only designed around DHTML browsers (IE and IE/Mac) - my Professional
Validation And More supports many more - and javascript may be disabled on
the browser.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top