How to use the parsleyjs.options function in parsleyjs

To help you get started, we’ve selected a few parsleyjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jirokun / survey-designer-js / lib / ParsleyWrapper.js View on Github external
constructor(el) {
    this.el = el;
    // validationでerrorとなったときのイベントハンドラ
    Parsley.on('field:error', (fieldInstance) => {
      if (isSP()) SPParseleyCallback.onError(fieldInstance);
      else PCParsleyCallback.onError(fieldInstance);
    });

    // validationでsuccessとなったときのイベントハンドラ
    Parsley.on('field:success', (fieldInstance) => {
      if (isSP()) SPParseleyCallback.onSuccess(fieldInstance);
      else PCParsleyCallback.onSuccess(fieldInstance);
    });

    // errorとなったときに付与するclass名を指定
    Parsley.options.errorClass = ERROR_CLASS;
    ParsleyWrapper.addCustomValidator();
    ParsleyWrapper.changeErrorMessage();
  }

parsleyjs

Validate your forms, frontend, without writing a single line of javascript!

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis