Input type decimal allows special characters

I am trying to set up an input to accept only valid latitude or longitude coordinates.

In order to do this I first set my input to decimal.

Then when testing to set up error messages and to verify the coordinates are valid I wanted to use extract with regex to check if there were any special characters besides a “.” or “-” because the decimal input allows special characters to be entered ( I assume for the reason to enable users to add the decimal point and a negative value ).

The problem that I encounter is that other special characters such as # or & can be entered into the input set to decimal and because it is a number I am unable to do an extract with regex function to check if such a special character was entered.

From my understanding using a text element to set a geographic location from coordinates is not possible, which is why I need to use the input set to type decimal.

Any work arounds?

Is it considered a bug that special characters besides the “.” and “-” are capable of being entered into the input set to type decimal? It doesn’t allow users to enter a letter so I’d assume the internal settings should be enabled eliminate the possibility of adding other special characters such as # or even a blank space between digits.

Hey @boston85719: Unless you’re building an app for geographers, I think this is what you are trying to do:

RUN MODE (read the page):

EDIT MODE (see how easy it is):

:point_up_2: the above is the best (IMHO, the only) way to collect locations in Bubble. I wish I could say that I designed it but it’s more like it’s one of the first things I stumbled upon when learning Bubble.

Thanks @keith what I have found is that entering an address doesn’t always return the most accurate results, especially in my location ( Thailand ). What I have opted to do was utilize longitude and latitude coordinates to get a more accurate location.

It will cause a bit more work on behalf of the user but the users are business owners who shouldn’t worry so much about the extra work needed to open up google and find those coordinates; I am planning on putting together an information popup to provide some instructions in app on how to do it as well as links to google maps.

A-ha, I see! If you haven’t you might want to look at @AliFarahat’s Google Maps Extended plug-in (I think that’s what it’s called) as it may give you the capabilities to snag these values right out of the map.

(I’m assuming you’re doing something like the “what’s here?” trick to expose lat/long…)

exactly, so my popup message for info would give details for user to do it

I actually saw it used just the other day for measuring distances and felt like I’d need to get it for that…good to know it would be useful for another aspect of the app. Thanks for the tip.

This topic was automatically closed after 14 days. New replies are no longer allowed.