Google XML Issue - Results not working as expected...


I have created a web page that returns a list of locations from Google Maps, when there are more than one result found, however when clicking on one of the results to confirm which I want, it doesn't seem to listen and simply reloads the page.  I have tried to alter the 'h ref' and direct the click straight to the confirmation page, however this unfortunately stops any of the code showing on the page, which is really strange...!

The HTML generated is:

<?xml version="1.0" encoding="ISO-8859-1"?>

<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-32" />
<title>Searching Address</title>
<form name="form1" method="post">
Fürth, GermanyThe address you requested returned multiple possibilities:<p><p><a href="searchaddress.asp?address=Fürth, Germany">Fürth, Germany</a></p><p><a href="searchaddress.asp?address=Furth, Germany">Furth, Germany</a></p><p><a href="searchaddress.asp?address=Furth im Wald, Germany">Furth im Wald, Germany</a></p><p><a href="searchaddress.asp?address=Fürth, Germany">Fürth, Germany</a></p></p><P>If the address is not listed, please try again, perhaps adding in more information:<p> <input type="text" size="50" name="address" id="address" value="Fürth, Germany" /><input type="submit" id="searchagain" name="searchagain" value="Search Again" /></p>


I have attached the ASP page here too.

Thanks for your help!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kim WalkerWeb Programmer/TechnicianCommented:
Could it be the spaces in your query string? Try url encoding the href.
Nico2011Author Commented:
Thanks but that doesn't work either...
Kim WalkerWeb Programmer/TechnicianCommented:
Does the file "searchaddress.asp" have code to process the query string? You said you attached the asp page but I don't see an attachment.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Nico2011Author Commented:
Aha - I'm to EE, so didn't see the 'Attach' button after browsing - should have known better...!  Attached now!  

Yes, there is some code, but a redirect.  It's really strange because as soon as the page name is changed, the page no longer works at all...!  Essentially, it is sent an addess through a querystring, which it then processes.  If it finds the address first time, then it forwards the user to a page and shows this on a map, but if there are more than one result found for the location (such as furth in Germany) it loops back on itself.  Sometimes however, if there is a larger list of results, it will work - as in takes the address te user has clicked on as the correct one, and passes it to the next page with the map.

Thanks again!
Kim WalkerWeb Programmer/TechnicianCommented:
Unfortunately, it's been ten years or more since I last looked at ASP. I got involved in this question because JavaScript was listed as one of the topics. Perhaps an ASP expert will join in, but you may have to repost the question with a different title that will attract ASP experts.

From what I've been able to understand from your code and my experience with Google maps, I'm wondering if the addresses listed will always return multiple possibilities. Have you tried searching for one of the alternatives first? Does it still return multiple addresses? If so, you may have to include more than just the address in your secondary searches.

In your initial post, it appears you have started a search for "Fürth, Germany" and received four possibilities. However, the first and last possibility are exactly the same as the initial search. Clicking either of those choices will repeat the exact same process again since the query string for both is exactly the same as the initial request, "Fürth, Germany".
Nico2011Author Commented:
Thanks for your help.  I did try to add on the lng/lat to each line, but when I do that, the first record never has that information - the others do...

Yes, sometimes the address gets found and the page bounces straight through to the map page, and it's only when there are multiple possibilities that this problem occurs.

I'll do as you suggest and repost - sorry I put Javascript in the topics - I'm working on so many pages and didn't realise this one doesn't have javascript...!
do your links now look like this?

Open in new window

Nico2011Author Commented:
Thanks - no they don't - they look like this: <a href="searchaddress.asp?location=Fürth, Germany">Fürth, Germany</a>

If I try to URL encode the URL, the page stops working altogether...!

(sorry I took so long to come back - I have been away)
If you have a search argument that doesn't include any space characters, does the link work?
Nico2011Author Commented:
nope - not at all...!  You can see what I'm up to at - try searching for Furth and you'll see the problem I'm having.  Thanks for your help!
1. I think you should be using location= rather than address=
2. When you retrieve the data for the combobox, it would be better if you assigned the key value to each entry and do your search by the location key value, instead of the name of the location.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nico2011Author Commented:
That works!  BUT I did have to add in a procedure to prevent the name coming up loads of times - for some reason, Google Maps has the same name with multiple lng/lat addresses.  Most important thing is that it now works - thank you so much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.