Skip to content

onkeyup not validating #84

Closed
Closed
@felipedeboni

Description

@felipedeboni

Hi,

I'm currently coding a freela and i've got this strange behavior... I don't have much time to explain, and it's an ecommerce project so i don't put code here.

Steps to reproduce:

1 - Create two required fields
2 - Set messages and all things you want.
3 - Start filing the second field and leave (it calls unhighlight and show the field is fine)
4 - Go back to second field and remove the content (it call highlight and show the error without leaving the field)
5 - Go to the first field, fill it and leave (calls unhighlight and show the field is fine)
6 - Go back to this and remove the content... it doesnt call the highlight method... i've been debugging the code and have noted the field doesnt is in this.submited array...

So even if you leave the field without content, it will never show de error. It will show error when you submit form, its the only way.

/* Solution (or workaround) */

in function element after this.showErrors() and before return i put this line:
if(!(element.name in this.submitted)) this.submitted[element.name] = "";

Maybe it's an workaround, but it worked for me and is the fastest way i can resolve this strange issue hehe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy