Autocomplete cuasing problems with client side validation controls

Discussion in 'ASP .Net' started by moondaddy, Apr 1, 2004.

  1. moondaddy

    moondaddy Guest

    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?

    --
     
    moondaddy, Apr 1, 2004
    #1
    1. Advertising

  2. moondaddy

    bruce barker Guest

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


    -- bruce (sqlwork.com)



    "moondaddy" <> wrote in message
    news:...
    > 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?
    >
    > --
    >
    >
    >
     
    bruce barker, Apr 1, 2004
    #2
    1. Advertising

  3. moondaddy

    moondaddy Guest

    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.

    --

    "bruce barker" <> wrote in message
    news:%...
    > You will have to catch the onblur, and revalidate the input.
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    > "moondaddy" <> wrote in message
    > news:...
    > > 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?
    > >
    > > --
    > >
    > >
    > >

    >
    >
     
    moondaddy, Apr 2, 2004
    #3
  4. 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.
     
    Jeffrey Tan[MSFT], Apr 6, 2004
    #4
  5. 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.
     
    Jeffrey Tan[MSFT], Apr 6, 2004
    #5
  6. 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.
     
    Jeffrey Tan[MSFT], Apr 8, 2004
    #6
  7. moondaddy

    moondaddy Guest

    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!

    --

    ""Jeffrey Tan[MSFT]"" <> wrote in message
    news:X$...
    > 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.
    >
     
    moondaddy, Apr 8, 2004
    #7
  8. 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.
     
    Jeffrey Tan[MSFT], Apr 8, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    14
    Views:
    4,140
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  2. =?Utf-8?B?dmlkeWE=?=
    Replies:
    1
    Views:
    763
    Kevin Spencer
    Jun 2, 2005
  3. Boss302
    Replies:
    0
    Views:
    1,070
    Boss302
    Nov 21, 2006
  4. Replies:
    0
    Views:
    406
  5. Bogdan
    Replies:
    2
    Views:
    667
    Bogdan
    Jun 9, 2008
Loading...

Share This Page