开发者

jQuery validation plugin validating html control only

I'm developing a form with client side validation using jQuery validation plugin.

This almost works perfect but i'm getting a problem:

The form is composed by 5 inputs. One input requires the content of other input(that must be valid) to proceed the validation, i show one example:

$('#submitionData').validate(
    {
                rules: {
                    tb_valorEmprestimo:
                    {
                        required: true,
                        min: 1000,
                        max: 999999999,
                        checkForTranche: true

...


jQuery.validator.addMethod("checkForTranche", function()
    {
        return $('#tb_tranche').valid() == 1 ? true : false
    }
, "Please Correct Tranche field");

Whe开发者_Go百科re #tb_tranche is the control i need to validate first, but one problem ocurrors, When the tb_tranche is valid the text saying ...Please Correct Tranche field continues appeearing in the tb_valorEmprestimo input..

Apreciate help guys, thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜