Parsley.js - Display errors near fields AND in a combined list above form

后端 未结 1 1923
萌比男神i
萌比男神i 2021-02-06 16:17
  1. Is it possible to configure Parsley.js to display its error messages both... a) next to individual fields, AND b) in a combined list elsewhere on the page ...at the sam

1条回答
  •  我在风中等你
    2021-02-06 16:34

    To accomplish what you want, you need to use Parsley's events. Take a look at the event's description and the comments on the below code.

    Here's a demo in Jsfiddle.

    Important note: the code I'm providing uses the events available in Parsley 2.0.* . If you're using the newly Parsley 2.1.*, you should use the correct events. Instead of parsley:form:validate use form:validate and replace parsley:field:error by field:error.

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