Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

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

Hello,

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="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-32" />
<title>Searching Address</title>
</head>
<body>
<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>

</form>
</body>
</html>

I have attached the ASP page here too.

Thanks for your help!
0
Nico2011
Asked:
Nico2011
  • 6
  • 3
  • 3
1 Solution
 
Kim WalkerWeb Programmer/TechnicianCommented:
Could it be the spaces in your query string? Try url encoding the href.
0
 
Nico2011Author Commented:
Thanks but that doesn't work either...
0
 
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.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
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!
searchaddress.txt
0
 
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".
0
 
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...!
0
 
aikimarkCommented:
do your links now look like this?
href="searchaddress.asp?address=Fürth,%20Germany"

Open in new window

0
 
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)
0
 
aikimarkCommented:
If you have a search argument that doesn't include any space characters, does the link work?
0
 
Nico2011Author Commented:
nope - not at all...!  You can see what I'm up to at www.gorgeous-villas.com/index2.asp - try searching for Furth and you'll see the problem I'm having.  Thanks for your help!
0
 
aikimarkCommented:
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.
0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now