Autocomplete cuasing problems with client side validation controls

M

moondaddy

I have a form for entering a user's address and all fields have a required
validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn't show unit the use hits the submit button or the user enters data and
moves the focus to another control so the field becomes dirty. So far so
good. Now when the user goes back to that control and starts to input data
the auto complete feature kicks in and shows them a list of options. If the
user selects an item from the autocomplete list or keys in the exact same
text as an item in the list and then moves the focus away from the field the
error msg does NOT go away. However, it the user keys in new data not found
in the autocomplete list and then moves the focus away then the error msg
DOES go away. This behavior is inconsistent and if the error msg does not
go away when it should then it can be confusing or misleading to the user
where they may think the field is not valid. NOTE: even if the error msg
remains showing even when it should have disappeared because the field is
valid, the page IS valid and can be submitted.

I don't want to turn off autocomplete because filling out addresses is one
of those things that people have to do too often and a lot of time can be
save using this feature. I personally would be annoyed if I had to enter my
address in full all the time. However, the issue of this error msg not
disappearing when it should is also annoying and confusing.

Any good solutions?
 
B

bruce barker

You will have to catch the onblur, and revalidate the input.


-- bruce (sqlwork.com)
 
M

moondaddy

Thanks Bruce. Does this happen to lots to other developers as well? I
would think it happens a lot and if I start writing my own validation in the
onblur event then I'm loosing some of the benefit of using the validation
controls in the first place, and I'm also leaving myself more open to bugs
and problems with other browsers. MS, if you are listening, do you have any
further comments on this?

Thanks again.

--
(e-mail address removed)
bruce barker said:
You will have to catch the onblur, and revalidate the input.


-- bruce (sqlwork.com)



moondaddy said:
I have a form for entering a user's address and all fields have a required
validating control associated with them and the error msg for each field
displays right next to it. The normal behavior is that the error msg
doesn't show unit the use hits the submit button or the user enters data and
moves the focus to another control so the field becomes dirty. So far so
good. Now when the user goes back to that control and starts to input data
the auto complete feature kicks in and shows them a list of options. If the
user selects an item from the autocomplete list or keys in the exact same
text as an item in the list and then moves the focus away from the field the
error msg does NOT go away. However, it the user keys in new data not found
in the autocomplete list and then moves the focus away then the error msg
DOES go away. This behavior is inconsistent and if the error msg does not
go away when it should then it can be confusing or misleading to the user
where they may think the field is not valid. NOTE: even if the error msg
remains showing even when it should have disappeared because the field is
valid, the page IS valid and can be submitted.

I don't want to turn off autocomplete because filling out addresses is one
of those things that people have to do too often and a lot of time can be
save using this feature. I personally would be annoyed if I had to
enter
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your feedback.

I can reproduce out your problem. I will spend some time to do some
research on this issue. Maybe I can find a better workaround for you.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Sorry for letting you wait for so long time.

After doing some research, I find that this is a known issue of IE
autocomplete function.

For Validation control, to do the client validation for certain html
element, it will use some client script function to "hook up" this html
element's change event, so that when the textbox's content is changed, it
can be notified.

But when the autocomplete is opened, if you select a different value
through autocomplete list, although the textbox content is changed, change
event will not fire for you.

The below javascript code proves this:

<INPUT type="text" name="abc" size="33" onchange="test()" id="abc">

<script language="javascript">
function test()
{
alert("abc");
}
</script>

So this issue is due to the IE issue, not the Validation control.

Actually, if you search in http://groups.google.com/ , you will find that
this is a frequently asked question, and many developers have met. From
these threads, you can see there are 2 ways to handle this issue, close
autocomplete or leverage onblur client event. Also, I have seen that you do
not want to close autocomplete function for your textbox, which will be
convinient for the customer. So I recommanded you leverage onblur event to
workaround this issue, I think it will not affect much to you.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Do you still have any concern on this issue? Does my reply makes sense to
you?

Please feel free to feedback, I will help you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

moondaddy

Thanks for all of the work on this issue. I have completely redesigned the
page and am only using the summary validation control to show the error
msgs. However, this is only a quick fix for this page and I'll be crossing
this issue again soon, so I've saved your posting for future reference. I'm
very sure I'll be making use of it, so another big thanks for all of your
work!
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your feedback.

I am glad I can help you. Ok, if you need further help, please feel free to
feedback, I will help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top