Dond RSS Feed

RSS Feed

DonD’s WebPlus Demo site

DonD 2012© No Rights Reserved

Page last updated 25/01/2012 10:24:02

Produced with

Site Feedback

Search

Intro 3rd Party X5 WP/X2/X4 Topical Demo's Forum Contact Downloads sitemap

Google Map Route finder

To make up the route finder form


1. From the form fly out toolbar choose the “blank form” button and draw a rectangle on the page. Then select the “edit box” from the toolbar and put onto the blank form.


2. Right click form background and select ID, make a note of this.


3. Right click the submit button and select “edit form button”. Change or add the following:-


Name - Getmap

Type - Normal

Label - Google Map


4. Right click the renamed Google map button and select “attach html” and when the attach html window opens follow the code across until you come to onclick=”    “ in the white area between the “” paste this code “if~(validate_form_3('form_3'))~location.href='http://maps.google.co.uk/maps?f=q&hl=en&geocode=&q=from:+'+document.getEl ementById('postcode').value.replace(/~/,'+')+'+to:+NG11+7EP'” without the quotes and with any spaces indicated by ~ which you will delete to leave a space. There are 3 ~.

Sorry if this code has confused people in the past.


5. Right click the edit box and select ID, change this to postcode


6. Right click the edit box and select “edit form edit box”. Change or add the following:-


Name - postcode


On the validation tab add this code “if( document.getElementById('postcode').value=="" ) { alert("Please enter your postcode!"); document.getElementById('postcode').focus(); return false; }” without the quotes in the white area over the text “//Custom Validation for element”


Note:-

1. This code is set to open Google maps in the same window. If you require it to open in a new window at the point in the code location.href='http://.......’  Change this to window.open('http://...','_blank');


2.All the items that are in BOLD are variable depending what you name other items and Google location. In this UK example with the use of our postcode NG11 7EP as the destination.


2/2

Google map

Google Route Finder


This is a form that Alfred put together so when a site visitor puts their postcode/zipcode into the form they will be taken to Google maps with a route laid out from their location to a pre-determined point you set up in the form.

If you try the form below it will take you to Serif HQ in the UK or USA. Only use the country that you live in as the route does not like crossing the big pond.

If you live in another country that is covered by Google maps follow the tutorial to get your own form working.

UK Serif HQ

USA Serif HQ

Zipcode
Postcode

2/2

Google map