Giter Club home page Giter Club logo

Comments (4)

orefalo avatar orefalo commented on August 26, 2024

Sorry for the late reply, could you please explain why you need two parameters to check if a username is already taken ?

one parameter should be enough...

To answer your question, no, it's not supported out of the box. yet you should be able to hook the ajax object in the onBeforeXXX methods() -> I didn't try.

from jquery-validation-engine.

WilkinsLeung avatar WilkinsLeung commented on August 26, 2024

Thanks for your reply.

Let's say ...

You login as orefalo in an application and you would love to change it to something else. The system will check if the username has existed from the database (thru Ajax). The system will output some warning message if the username has been used by others.

However, when I put in orefalo again in the username field and hit save, the system tells me that it has been registered in the system. I think I need to pass another parameter to exclude the original value, ie.orefalo in the search.

Any ideas?

Thanks for your help

Wil

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

I am afraid we do not support this scenario at the field level.

Ajax form validation should however do the job.
You could simply use two input fields, on visible the other hidden to get this working.

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

Actually, you can pass extra parameters by using the onBeforeXXX methods.

There you can change the extraData attribute : it is used to construct the URL

           "ajaxUserCall": {
                "url": "http://localhost:9173/ajaxValidateFieldUser",
                // you may want to pass extra data on the ajax call
                "extraData": "name=eric",
                "alertText": "* This user is already taken",
                "alertTextLoad": "* Validating, please wait"
            },

from jquery-validation-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.