Passport number form with per-country formats
You get a map from country to passport number format, for example {USA: "LLDDDD", Canada: "AALLDDDD"}, where L must be a letter, D a digit and A either one.
- Build the layout: a country selector filled from the map, a passport number input and a Validate button.
- Write a function that takes a country and a passport number and says whether the number matches that country's format, then connect it to the form.
No answer yet. Write the first one; the best answer gets endorsed.
