Page 1 of 1

How can I validate address entered in an input field?

Posted: Thu Jul 17, 2014 11:25 pm
by xman

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).


How can I validate address entered in an input field?

Posted: Thu Jul 17, 2014 11:44 pm
by obullei

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


How can I validate address entered in an input field?

Posted: Thu Jul 17, 2014 11:46 pm
by xman

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.


How can I validate address entered in an input field?

Posted: Fri Jul 18, 2014 12:13 am
by obullei

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/...