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

前端 未结 3 471
攒了一身酷
攒了一身酷 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 01:01

    Spot on Gajotres with adding ignore to the bassistance.de jquery validation plugin!

    {ignore:""} 
    

    ...worked for me.

    I did come accross an issue when I tried to fix this with css. The DropKick version I had [1.0.0] hides the select boxes with a inline display:none. This couldn't be overwritten from a stylesheet so I had to comment out the line in the dropkick.js which hid the select boxes:

    //$select.hide(); 
    

    @ line 150 in the plugin for me.

    And to finish things off I hid the select boxes manually in the CSS by pulling them off the screen:

     position:absolute; 
     left:-9999em;
    

    Worked fine. Maybe newer versions hide things differently?

提交回复
热议问题