1

I have two fields. I want to have first field to be more than zero(0) and the second field to be more than one(1). Also the first field should never be equal to or greater than the second field.

this is what i have done so far

$("#entryForm").validationEngine();

$('#field1').rules('add', {
    min: 1,
    messages: {
        required: 'Some custom message for the required field'
    }
});

$('#field2').rules('add', {
    min: 2,
    messages: {
        required: 'Some custom message for the required field'
    }
});
5
  • I am trying to add the rules without modifying the jquery.validationEngine-en.js file Commented May 14, 2012 at 5:10
  • please find the code in the question itself. it's being edited now Commented May 14, 2012 at 5:20
  • $("#field1").rules is not a function [Break On This Error] required: 'Some custom message for the required field' Commented May 14, 2012 at 5:47
  • There are lot of examples are given here for usage of validationengine,.js github.com/posabsolute/jQuery-Validation-Engine Commented May 14, 2012 at 5:52
  • yeah i have gone through it but never found the comparison sort of thingy Commented May 14, 2012 at 6:13

1 Answer 1

1

May be you can try something like this:

<input value="field1" class="validate[required,equals[field2]] text-input" type="text" name="field2" id="field2" />

Or You can write a separate function call do the validations there as well.All these mentioned here:

http://www.position-relative.net/creation/formValidator/demos/demoValidators.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.