Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

digits validation doesn't work for input='number' in FF #100

@rafalskyi

Description

@rafalskyi

in FF in input='number' angular validation fired first when enter letters and i am getting empty message.
temp solution

angular.module(app_name).factory('numberOnlyValidator',  function () {
  return {
    name: 'numberOnly', // this is the validator name that can be referenced from the constraints JSON
    validate: function (value) {
      // value: the value to validate
      // arguments: the validator arguments
      return /^[1-9]\d*(\.\d+)?$/.test(value);
    }
  };
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions