ember-changeset-validations icon indicating copy to clipboard operation
ember-changeset-validations copied to clipboard

Readme "validateNumber" incorrect description

Open matthewvalimaki opened this issue 8 years ago • 2 comments

The readme for validator number contains the following:

propertyName: validateNumber({ gte: 10 }), // greater than or equal to 5

Comment there should say 10 instead of 5.

matthewvalimaki avatar Jan 05 '17 15:01 matthewvalimaki

Thanks! Would you like to open a PR to correct this?

poteto avatar Jan 06 '17 23:01 poteto

Number is not perfect as validation. HTML 5 validation of type="number" will not return a value when the number field has non numerical characters in it.

You can do something like typeof element.validity !== "undefined" to first see if the input is refusing to pass the value it contains to javascript.

MatthewPringle avatar Apr 24 '17 15:04 MatthewPringle