1

私は2つのフィールドを持っています。最初のフィールドを 0 (0) より大きくし、2 番目のフィールドを 1 (1) より大きくしたい。また、最初のフィールドが 2 番目のフィールド以上であってはなりません。

これは私がこれまでやってきたことです

$("#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'
    }
});
4

1 に答える 1

1

次のようなことを試すことができるかもしれません:

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

または、別の関数呼び出しを記述して、そこで検証を行うこともできます。これらはすべてここに記載されています:

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

于 2012-05-14T06:28:40.600 に答える