How to use the parsleyjs.addValidator 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
validateNumber: (value, requirement) => value === requirement,
      messages: {
        ja: '%sになるように入力してください',
      },
    });

    Parsley.addValidator('ne', {
      requirementType: 'integer',
      validateNumber: (value, requirement) => value !== requirement,
      messages: {
        ja: '%s以外の数値を入力してください',
      },
    });


    Parsley.addValidator('positiveInteger', {
      requirementType: 'digits',
      validateString: value => parseInteger(value).toString() === value && parseInteger(value) >= 0,
      messages: {
        ja: '不正な数値形式です',
      },
    });
  }
github jirokun / survey-designer-js / lib / ParsleyWrapper.js View on Github external
static addCustomValidator() {
    Parsley.addValidator('eq', {
      requirementType: 'integer',
      validateNumber: (value, requirement) => value === requirement,
      messages: {
        ja: '%sになるように入力してください',
      },
    });

    Parsley.addValidator('ne', {
      requirementType: 'integer',
      validateNumber: (value, requirement) => value !== requirement,
      messages: {
        ja: '%s以外の数値を入力してください',
      },
    });
github jirokun / survey-designer-js / lib / ParsleyWrapper.js View on Github external
static addCustomValidator() {
    Parsley.addValidator('eq', {
      requirementType: 'integer',
      validateNumber: (value, requirement) => value === requirement,
      messages: {
        ja: '%sになるように入力してください',
      },
    });

    Parsley.addValidator('ne', {
      requirementType: 'integer',
      validateNumber: (value, requirement) => value !== requirement,
      messages: {
        ja: '%s以外の数値を入力してください',
      },
    });


    Parsley.addValidator('positiveInteger', {
      requirementType: 'digits',
      validateString: value => parseInteger(value).toString() === value && parseInteger(value) >= 0,
      messages: {
        ja: '不正な数値形式です',
      },
    });
  }

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