JQuery Validate Uncaught TypeError: Cannot read property 'settings' of undefined

前端 未结 1 1291
陌清茗
陌清茗 2020-12-17 15:45

I am using JQuery Validate on a JQuery Mobile form that has a listview with an Auto Complete option that is created dynamically.

I get this error if you try and type

相关标签:
1条回答
  • 2020-12-17 16:09

    Your whole problem is being cause by the dynamic HTML that is created by the listview() function. Inspecting the DOM reveals that this dynamically creates a new <form> container. Since you've placed listview within your <form> container, you now have <form></form> nested within <form></form>, which is very invalid HTML, and the whole reason the jQuery Validate plugin is working so unexpectedly.

    The solution is to place your listview element outside of your <form> container.

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