]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
Validate countrycodes (#108)
authorotbutz <tbutz@optitool.de>
Tue, 23 Mar 2021 23:09:26 +0000 (00:09 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Mar 2021 23:09:26 +0000 (00:09 +0100)
* Change label to `Country Codes`
* Validate country codes input

src/components/SearchSection.svelte

index 207af21ff20d613994f9c73acc60497b17d4a28b..d321eb4c3be1ebc52b4f98c9faf151a0b42dc1e8 100644 (file)
     </li>
 
     <li>
-      <label for="option_ccode">Countries</label>
+      <label for="option_ccode">Country Codes</label>
       <input type="text" placeholder="e.g. de,gb" class="form-control form-control-sm d-inline w-auto api-param-setting"
-             data-api-param="countrycodes" id="option_ccode" size="15"
+             data-api-param="countrycodes" id="option_ccode" size="15" pattern="[a-zA-Z]{2}(,[a-zA-Z]{2})*"
              value="{api_request_params.countrycodes || ''}"
              on:change={set_api_param}>
     </li>