RequiredFieldValidator Control Bug?

A

Arpan

Suppose I have the following RequiredFieldValidator control which
validates a TextBox:

<form id="form1" runat="server">
<asp:TextBox id="txtVal" runat="server"/>
<asp:RequiredFieldValidator id="reqVal" ControlToValidate="txtVal"
ErrorMessage="Please enter a value in the TextBox!" Display="Dynamic"
runat="server"/>
<asp:Button id="but1" Text="SUBMIT" runat="server"/>
</form>

Now IE6 has this auto-complete feature which drops-down a list of
similar values which were previously entered in the TextBox that
currently has the focus as & when some text is being typed in that
TextBox.

Suppose I type the text "466" (without the quotes) in the TextBox &
press the Tab key on the keyboard. Without submitting the Form, I shift
the focus back to the TextBox & delete the text i.e. make the TextBox
empty. Next when I press the Tab key again, the RequiredFieldValidator
promptly displays the error message.

Again without submitting the Form, I shift the focus back to the
TextBox & press 4 on the keyboard. IE's auto-complete feature
drops-down a list which lists 466. If I type "466" (again without the
quotes) manually from the keyboard & press the Tab key, the error
message, as expected, disappears but instead of manually typing 466, if
I populate the TextBox by clicking 466 from the auto-complete drop-down
list that IE shows & then press the Tab key, the error message still
remains as it is though the TextBox is no longer empty now; it has been
populated with 466.

Is this some sort of bug in the RequiredFieldValidator control?

Thanks,

Arpan
 
N

Nicole Calinoiu

This might actually be more of an IE bug than a bug in the validation
control, but that's not likely to be of much help to you. <g>

The underlying problem is that IE is not firing the onchange event when an
item was selected from the previous entries list in the way you describe.
The client-side code for the validation controls could possibly work around
this by using the onblur event, so it might be worthwhile to report the
issue at http://connect.microsoft.com.
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top