xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

How can I validate address entered in an input field?

I need to validate a street address entered into an "Address" input field (before I store that address in the DB). How do I go about that?

For example, if the user enters an invalid street address for Washington, DC:

"293834 Peddington St"

I need to validate if that address actually exists, and flag something like:

"293834 Peddington St does not exist! Please check your address"

Is it possible to achieve something like that? (I do understand how I can make entering the State, City and Zipcode and make them mandatory, I am looking beyond that).

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

How can I validate address entered in an input field?

Hello!

It is possible to implement this function.
You need to add custom code as:

codevar addressValue = Apperyio("addressInputName").val();
if(addressValue == "")
alert("Enter address please");/code

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

How can I validate address entered in an input field?

No Arina, that is not what I'm looking for. I stated that I know how to do that.

What I'm looking for is that if the address entered actually exists on the map.

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

How can I validate address entered in an input field?

Hello!

I apologise for the misunderstanding.
To implement this function you can use geocoding.
You can find more information here:
https://developers.google.com/maps/do...

Here is an example of query that you can use (need to change address):
https://maps.googleapis.com/maps/api/...

Return to “Issues”