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

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

Open
rafalskyi opened this issue Feb 25, 2016 · 0 comments
Open

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

rafalskyi opened this issue Feb 25, 2016 · 0 comments

Comments

@rafalskyi
Copy link

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);
    }
  };
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant