Skip to content

Commit

Permalink
Don't allow . as a lat/lon separator
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis committed Jun 11, 2023
1 parent d607aa8 commit 0a42c74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h1>🗺️ All The Maps</h1>
<h2>Enter <label for="location">Location</label></h2>
<input id="input" type="text" name="location" size="20"
placeholder="latitude,longitude" autocomplete="on" autofocus required
pattern="[^0-9-]*(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9-]+(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9]*">
pattern="[^0-9-]*(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9.-]+(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9]*">
<input type="submit" value="Go">
<!--
Keep vertical content below the text input element to the absolute minimum
Expand All @@ -134,7 +134,7 @@ <h2>Enter <label for="location">Location</label></h2>
</div>

<script type="text/javascript">//<![CDATA[
const any_lat_long = /[^0-9-]*(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9-]+(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9]*/;
const any_lat_long = /[^0-9-]*(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9.-]+(-?[1-9]*[0-9]+(?:\.[0-9]+)?)[^0-9]*/;
const strict_lat_long = /^#(-?[1-9]*[0-9]+(?:\.[0-9]+)?,-?[1-9]*[0-9]+(?:\.[0-9]+)?)$/;

var geo_handler = undefined;
Expand Down

0 comments on commit 0a42c74

Please sign in to comment.