0

Most of the docs I found is not helping me as it seems to be outdated or I am doing something wrong.

$.fn.parsley.defaults = {} // not working
window.parsley.defaults = {} // not working
window.ParsleyConfig = {} // not working

Basically what I am trying to do is, I want the below given options to set globally and not repeat the same code for each form in my application:

$('#sign-in-form').parsley({
    successClass: "has-success",
    errorClass: "has-error",
    classHandler: function (el) {
      return el.$element.closest(".form-group");
    },
    errorsWrapper: "<span class='help-block'></span>",
    errorTemplate: "<span></span>"
  });

The above code is working (along with bootstrap)

Syed
  • 15,657
  • 13
  • 120
  • 154

1 Answers1

1

I hope to have improved the doc enough to answer your question.

Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166