country-region-selector icon indicating copy to clipboard operation
country-region-selector copied to clipboard

Validating input

Open tremby opened this issue 8 years ago • 2 comments

Given that this is being used on the client side and then data sent to the server, once on the server side, can I use this module in Node to validate the input data? How would I go about doing that?

tremby avatar Apr 11 '16 22:04 tremby

Since the input is a drop down unless you allow users to input the data, then there is no way to know it's correctness without looking and checking as human. To check the accuracy using the data the options come from would only reinforce that the data comes from this list. which seems redundant. The list is supposed to use ISO3166-2 codes so you could maybe do something with that?

ellenhutchings avatar Apr 11 '16 23:04 ellenhutchings

I was more thinking along the lines of if the package were to provide a validate function which takes a country and region as selected from the dropdown it provides, and returns true or false depending whether those values make sense given the data in the package.

tremby avatar Apr 11 '16 23:04 tremby