jQuery multiple input name[] validation

前端 未结 1 1935
太阳男子
太阳男子 2020-12-11 07:55

I\'ve got multiple inputs with the name test[]




        
相关标签:
1条回答
  • 2020-12-11 08:34

    The jQuery Validate plugin will not allow you to validate multiple input elements with the same name. You must have a unique name on each. There is no workaround; the name attribute is how the plugin internally keeps track of all form inputs.

    <input type="text" placeholder="" class="m-wrap span12" name="test[1]">
    <input type="text" placeholder="" class="m-wrap span12" name="test[2]">
    <input type="text" placeholder="" class="m-wrap span12" name="test[3]">
    

    DEMO: http://jsfiddle.net/CcxZx/

    0 讨论(0)
提交回复
热议问题