• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: google map in new window based on a field value

google map in new window based on a field value 15 years 5 months ago #5310

  • iidx036
  • iidx036's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hi all,

Is it possible to have a text field that allows entry for a zip/post code then a button next to it that would when clicked fire up a new window showing it on google maps? (NOTE: The form wouldn't have been submitted at this point)

I can do it in VBA like this:
Dim ie As Object
Dim strURL As String

strURL = \"maps.google.co.uk/maps?q=\"; & postcode & \"&iwloc=A&hl=en\"
If postcode = \"\" Then
MsgBox \"No postcode entered\"
Else
Set ie = CreateObject(\"InternetExplorer.Application\")

ie.Navigate strURL 'load web page for Google Maps
And I was hoping to use something simliar in RS Forms so I suppose is it possible, and if so, could someone give me a few pointers?

Cheers

Jay
The administrator has disabled public write access.

Re:google map in new window based on a field value 15 years 5 months ago #5347

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

Here's the solution for RSform! Pro:
1) I've setup a button component (not a submit button!). On the additional attributes field, this is what I've written:
onclick="openzip();"
2) A textbox named "zipcode". Nothing special here.
3) In the Form Layout tab, disable the autogenerate layout feature; this will allow you to edit the form layout text. At the end of the layout, paste this code:
<script type="text/javascript">;
function openzip()
{
 var zipcode = document.getElementById('zipcode').value;
 if (zipcode == '') alert('No postcode entered');
 else window.open ('http://maps.google.co.uk/maps?q=' + zipcode + '&iwloc=A&hl=en','zipcode'); 
}
</script>

If you want to customize your window, you can read more about it here:
www.javascript-coder.com/window-popup/ja...pt-window-open.phtml
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 15 years 1 month ago by bogdan.
The administrator has disabled public write access.

Re:google map in new window based on a field value 15 years 5 months ago #5358

  • iidx036
  • iidx036's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Strafe,

You are a superstar! It works perfectly :)

Thanks very much.

Jay
The administrator has disabled public write access.

Re:google map in new window based on a field value 15 years 1 month ago #6776

Very cool solution.

I have a similar need but I have a list of zip codes that I want to give a different return page or open new window for. Any hints on syntax?


bob
The administrator has disabled public write access.

Re:google map in new window based on a field value 12 years 1 month ago #16535

  • deezyn
  • deezyn's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi Octavian,

I was just wondering if there is any way of sending a url link (and/or the picture of the property) to the admin email of the address from Google Maps?

Deezyn
Last Edit: 12 years 1 month ago by deezyn. Reason: additional request
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!