close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Does the page have to reload once a user clicks on the submit button?

Thread began 3/03/2009 5:45 pm by jules.webb286095 | Last modified 5/24/2009 6:36 am by theaellen380465 | 3250 views | 6 replies |

jules.webb286095

Does the page have to reload once a user clicks on the submit button?

I am using the current version of Pro Maps for Google and Dreamweaver CS3. I have included a form to retrieve directions.

I am wondering if there is any way to prevent the page from completely reloading once the submit button is clicked? Having to scroll back down to the map is not the smoothest of transitions for users and I was wondering if there was any way around that.

Thanks for any enlightenment!

Jules

Sign in to reply to this post

Ray BorduinWebAssist

There is a way to do it with scripting by hand, but no way from within the wizard.

An example (not working because of a bad key, but you could copy and paste the source to play with it) is at: AboutUs.php

Sign in to reply to this post

jules.webb286095

thanks for the response Ray.

I did copy and paste the source code into Dreamweaver, used my google key and took a look. I was assuming that the hand coded script was already on this page, but considering it doesn't have a form on it and I didn't see any notable differences in the javascript, I'm thinking you believe I can come up with the hand coding myself. Oh how I wish that were true, but there are oh so many things to learn, and only so much time to do the learning! I am working at it, but for now I would need more direction than your reply included. I had thought that maybe this was something that had already been done and the info could be passed along.

Thanks for you time

Jules

Sign in to reply to this post

Ray BorduinWebAssist

It is actually implemented on that page. Use a copy of that page and only change the api key so it works on your server to see how it works.

To do it yourself you would use code like:

onClick="wagmp_map_1(document.getElementById('fromaddress').value+', '+document.getElementById('fromcity').value)"

with the updated functions from that example this would work

Sign in to reply to this post

jules.webb286095

I'm sorry Ray, I'm just not getting it.

Just to make sure we understand each other:
I want to prevent the page from reloading so that after the submit button on the getDircections form is clicked the information is loaded into the wagmp_directions_1 div without the whole page having to reload. I am not interested in a separate info window opening up. The function your example code came out of (see below) doesn't look like it'll do what I want. And the buyFTANow.com page you referred me to doesn't have a form to get directions anyways, which is confusing to me and why I don't think we are talking about the same thing. Would you mind have another go at an explanation for me?

Thanks, I appreciate you taking the time!
Jules

function updateInfoWindow() {
wagmp_map_1_obj.markers[0].openInfoWindowHtml('<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>from address:</strong><br><input id="fromaddress" type="text"><br><strong>city, state:</strong><br><input id="fromcity" type="text"><br><input type="button" value="get directions" onClick="wagmp_map_1(document.getElementById(\'fromaddress\').value+\', \'+document.getElementById(\'fromcity\').value)"></span>')
}

Sign in to reply to this post

Ray BorduinWebAssist

The functions on the page were updated to work. I think you would need a good understanding of writing javascript to customize the example.

The form in the example is dynamically created in the info window... but it would be a simplified sample for what you need. You are going to need a javascript expert if you can't understand the example.

Sign in to reply to this post

theaellen380465

Time for AJAX

One way to reload the page but not the map settings is to use AJAX, or Asynchronous Javascript. This lets the submit button call the server, and the server responds with the answer, the section of the page gets updated (via the HTML document object model e.g. var newSection = getElementById('thisTag')

It works beautifully. I did mine "by hand" but there are many frameworks and helpers out there for non programmers. This example you cited is the perfect application for AJAX because you don't want to reload the entire page if it has a map on it.

Thea

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...