How to use jQuery Validate form validation with dropkick select elements (DIV based select form element)

前端 未结 3 468
攒了一身酷
攒了一身酷 2021-01-22 00:05

I want to use jQuery validate library on a div based select form element. I am using the dropkick library to beautify my selects, but I am having difficulties trying to validate

3条回答
  •  走了就别回头了
    2021-01-22 00:38

    I understand this is a long overdue answer but I have found an solution. Validation is not working with dropkick library because original select box was given display: none; css style.

    Fix, force original select box css with:

    display: block !important;
    

    This will make it visible but it will not be visible because new custom select box is over it.

    Or add this line to validator config:

    ignore: ""
    

    It will prevent plugin from ignoring elements with display: none.

提交回复
热议问题