Passport number form with per-country formats

0
Remix

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.

  1. Build the layout: a country selector filled from the map, a passport number input and a Validate button.
  2. 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.
StripeTechnical phone screenLast asked Aug 2025
No answer yet. Write the first one; the best answer gets endorsed.