Hi, maybe my solution can help you... I had the same problem with searching with an empty value zip code (after this module display all points in db). I used javascript. When user didn't input any value in field and click 'submit' see on screen window alert.
If you are interested, hier is two steps how I made this:
1. First - copy this javascript code and paste it on begin your search template (on red are my coments, not code):
{literal}
{/literal}
OK, we have included javascript.
2. Second - in search template in line when is called form change tag {$formstart} for this:
{$formstart|replace:'class="cms_form"':'class="cms_form" onsubmit="return formCheck(this);"'}.
Best regards,
Marek A.
BTW - I'm not sure that is a bug... but if I input value "0" in field I see all points (in Poland isn't postal code "0", so module shoud display error with bad code....)
PostCode Lookup - Displaying all results
Re: PostCode Lookup - Displaying all results
Last edited by maranc on Tue Aug 03, 2010 5:18 pm, edited 1 time in total.
Re: PostCode Lookup - Displaying all results
I got sick of everything not working so I went and Upgraded everything to the newest version. I has helped.
I dont think there is a Problem with CD to CGgoogleMaps i think its more the Postcode module with the Company Directory Module. Because it works when we use the IP Geolocation method Janb described before.
I am doing an AUS store locator and I have imported all Aus postcodes and there geodetails and when I do a Postcode Lookup witihn the Module Admin it works fine using Database only. Although when the Company Directory trys to use it it show the "Could not find Postocode error".
If you take out the Google Maps part and try to do a postcode search using only "Online Lookups" do you get an error or does it work ok.
I dont think there is a Problem with CD to CGgoogleMaps i think its more the Postcode module with the Company Directory Module. Because it works when we use the IP Geolocation method Janb described before.
I am doing an AUS store locator and I have imported all Aus postcodes and there geodetails and when I do a Postcode Lookup witihn the Module Admin it works fine using Database only. Although when the Company Directory trys to use it it show the "Could not find Postocode error".
If you take out the Google Maps part and try to do a postcode search using only "Online Lookups" do you get an error or does it work ok.
-
- Power Poster
- Posts: 280
- Joined: Thu Apr 15, 2010 12:27 am
- Location: Georgia
Re: PostCode Lookup - Displaying all results
james123,
I can go into my Postcode module. Select online only, put in my postcode, and it displays the correct information regarding my zip code. So the module is functioning. It's just the communication between modules is where it seems to be an issue.
Maranc,
this seems like a cool fix! Do you know of a way to set it to where you can't just hit 0 and display all CD entries? Maybe set it to where it requires at least 3 numbers before it can search for a postcode? Great work!
I can go into my Postcode module. Select online only, put in my postcode, and it displays the correct information regarding my zip code. So the module is functioning. It's just the communication between modules is where it seems to be an issue.
Maranc,
this seems like a cool fix! Do you know of a way to set it to where you can't just hit 0 and display all CD entries? Maybe set it to where it requires at least 3 numbers before it can search for a postcode? Great work!
Re: PostCode Lookup - Displaying all results
I'm not expert in javascript... but find in code and use (add) this code in red:
case "text":
case "textarea":
if (obj.value == "" || obj.value == null ||obj.value.length != 6)
I thing that obj.value == "" || obj.value == null can be remowed, because obj.value.length != 6 check and verify that zip code has 6 enter (example 10-170). If in your country zip code are different plase change value '6' for your standard.
BTW - maybe some one who has more knowleg in javascript know how check and verify that in entered value are only aprovated digits...
Marek A.
case "text":
case "textarea":
if (obj.value == "" || obj.value == null ||obj.value.length != 6)
I thing that obj.value == "" || obj.value == null can be remowed, because obj.value.length != 6 check and verify that zip code has 6 enter (example 10-170). If in your country zip code are different plase change value '6' for your standard.
BTW - maybe some one who has more knowleg in javascript know how check and verify that in entered value are only aprovated digits...
Marek A.