Ben Hayes Ben Hayes - 9 months ago 53
jQuery Question

LiveValidation with Autocomplete Google Maps Places API

What I'm Using:

I have an Eloqua form that uses LiveValidation and Google Maps Places API to autocomplete the company field and fill out contact fields (country, state, city, etc..).

The Issue:

This works well, but I'm running into a bug when it comes to changing values and reattempting to autocomplete again. The LiveValidation places an incomplete field warning even if a field is filled in properly. Is there a way to dynamically update this to show the correct validation?

Directions to reproduce the issue:

1. Fill out the company field with a company name such as "Target".

2. Select the company you want and then the contact fields will autocomplete with your selected companies contact details.

3. Remove text from the city or address field.

4. Remove the company you entered in the company field before. Re-enter a company name and select that company.

5. The empty field you removed (city or address) now has a red box around it stating the field is not valid despite that it has content with in it.

Page in Question:

Answer Source

The issue was with the JavaScript on the page. Instead of using multiple "===" operator I should have been using "==".