Giter Club home page Giter Club logo

Comments (14)

orefalo avatar orefalo commented on August 26, 2024

you may add as many validation conditions as required for a given field. validations are evaluated left to right.

So you could for instance have a validation such as

validate[customer[number],funcCall[myMethod]]

There are two validations in the code above but you may have more

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

Ok, however something like I've tried ;)
customer is function?
When I write for example this: class="validate[custom[number],min[1],funcCall[fields]]",
The first two options works, but funcCall stops working.

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

what is "fields" in your example above ?

fields should be a javascript function defined in the and with the following signature

function fields(field, rules, i, options) {

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

Yes, exactly as the demo.
function fields(field, rules, i, options) {..
optional,funcCall[..] - it separately works

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

I would be very surprise if the issue was on our side, but.. we never know.

could you prepare a unit test and send it? I will look into it

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

What is unit test?

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

http://en.wikipedia.org/wiki/Unit_test

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

It works fine, and here is how to validate it.
Open demoValidators.html, line 129 : replace

by

<input value="" class="validate[required,custom[number],funcCall[checkHELLO]] text-input" type="text" id="lastname" name="lastname" />

now double click the HTML file, enter "a" in the appropriate field.
-> the label comes back as

  • Invalid floating decimal number
  • Please input HELLO

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

NO it's not working well, If I write HELLO, its write message: Invalid floating decimal number!
But it's not my problem.
Pls, read my first question again...
My problem is optional parameter, or
--At least one field is required--
validation. !!
Problem is that, if I tried: validate[optional,custom[number],funcCall[field1_or_field2_or_field3]](what you've indirectly advised) it works in demo fine, but on my web isn't. ;) And I don't know where I have something else...;)

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

Sorry I have problems reading your english.
I am still trying to understand your messages.

If it works in the demo and not in your code, then it's an issue with your code. Without unit test or at least extracts from your code, it is really hard to guess the issues you may have created.

NO it's not working well, If I write HELLO, its write message: Invalid floating decimal number! -> of course, it's a customer[number] validation.

I would recommend to look at the browser's java console to identify the issue - sorry it's not on our side.

Sincerely,

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

Sorry for my english, but I thought that you understand me..
But I don't understand to this: of course, it's a customer[number] validation. ??
Do you think this is due to the application of validation number to text? then I understand. ;) Ok,I will find what I have wrong.

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

ok the field validation is

It checks,

  1. that the field is filled with something
  2. that it's a number
  3. finally the chechkHello validates that the string equals "HELLO"

right there you can see that it is impossible to pass this test, obviously a number (test2) can't be equal to "HELLO" (test3)

But it proves that there is nothing wrong with the validations, they work as designed.

from jquery-validation-engine.

Houbeless avatar Houbeless commented on August 26, 2024

:DD I understand.
But this is not my problem...

from jquery-validation-engine.

orefalo avatar orefalo commented on August 26, 2024

Please reformulate your problem, I read it 20 times - I don't get it

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.