Skip to content

Error on length validation if it's with server validation #502

Open
@fabio-ravizzotti

Description

@fabio-ravizzotti

Hi,
there is a possible problem when you work with (in my case) length and server validation.

I'have an input field for "username" that I need to validate both lenght and server.
Lenght for maximum number of charter.
Server for avoid duplicated usernames.

This is the html code:
<input type="text" class="form-control" data-validation-help="ATTENZIONE: l'username servir&agrave; per l'accesso al sito." required data-validation="length server" data-validation-length="max56" data-validation-url="/mysite/index.php/setting/check_username" id="ut_username" name="ut_username" required />

The function "check_username" returns the follows jsons:
-if it's TRUE: {"valid":true,"message":""}
-if it's FALSE: {"valid":false,"message":"Username already exists"}

The issue is: if you first insert a duplicated username, it appears the right message, but if after you insert a username longer than 56 character it prints always the message for the duplicated username and not the right message.

May you check it, please?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions