Google Groups Home
Help | Sign in
I'm an absolute beginner. Unable to run this script.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Kel  
View profile
(1 user)  More options Apr 30, 2:40 pm
From: Kel <gdw.mas...@gmail.com>
Date: Wed, 30 Apr 2008 11:40:24 -0700 (PDT)
Local: Wed, Apr 30 2008 2:40 pm
Subject: I'm an absolute beginner. Unable to run this script.
Hi,

I just want to make a dropdown box and when I submit it, multiple
markers should appear. In this case I only added two. Can you help?
Please don't laugh at me. I'm only starting javascript also.

<script type="text/javascript" align="center">

        function map() {

                var map = new GMap(document.getElementById("map"));
                map.centerAndZoom(new GPoint(-83.022206, 39.998264), 3);
                map.addControl(new GLargeMapControl());

                                                                                //]]>
                }

    </script>

<script type="text/javascript">

function setloc() {

                x=document.Group.grup.value;

                        if (x<>2) {

                alert("AKO");
         }

}

        x=document.Group.grup.value;

                        if (x==1) {

                        var map2 = new GMap(document.getElementById("map2"));
                        map2.centerAndZoom(new GPoint(-83.022206, 39.998264), 3);
                        map2.addControl(new GLargeMapControl());

                        var point = new GPoint(-83.015522, 40.002068);
                        var marker = new GMarker(point);
                        map2.addOverlay(marker);

                                        }
                        }

    </script>

   </head>

<body onload="map()">

        <div id="map" style="width: 500px; height: 400px;"></div>

        <form name="Group" method="post">

        <select>
                        <option name="grup" value="0">Select Customer Group</option>
                        <option name="grup" value="1">BASF HOLDINGS   </option>
                        <option name="grup" value="2">BAYER HOLDINGS  </option>
                        <option name="grup" value="3">GSK HOLDINGS    </option>

        </select>

        <input type="submit" value="SEARCH" onSubmit="setloc();">

        </form>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maps.huge.info [Maps API Guru]  
View profile
(3 users)  More options Apr 30, 2:42 pm
From: "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
Date: Wed, 30 Apr 2008 11:42:26 -0700 (PDT)
Local: Wed, Apr 30 2008 2:42 pm
Subject: Re: I'm an absolute beginner. Unable to run this script.
Since you're a beginner, I suggest you begin correctly and that starts
by reading the posting guidelines at the top of this forum.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kel  
View profile
(1 user)  More options Apr 30, 2:45 pm
From: Kel <gdw.mas...@gmail.com>
Date: Wed, 30 Apr 2008 11:45:41 -0700 (PDT)
Local: Wed, Apr 30 2008 2:45 pm
Subject: Re: I'm an absolute beginner. Unable to run this script.
Thanks much! Currently, I have not put it online. The browser that I
use is Firefox.

On May 1, 2:42 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kel  
View profile
(1 user)  More options Apr 30, 5:45 pm
From: Kel <gdw.mas...@gmail.com>
Date: Wed, 30 Apr 2008 14:45:26 -0700 (PDT)
Local: Wed, Apr 30 2008 5:45 pm
Subject: Re: I'm an absolute beginner. Unable to run this script.
O I really can't find related topics. Some maps here are using direct
links but not something like coming from a dropdoen box/menu. Help
anyone?

On May 1, 2:45 am, Kel <gdw.mas...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
warden [Andrew Leach - Maps API Guru]  
View profile
(1 user)  More options Apr 30, 7:20 pm
From: "warden [Andrew Leach - Maps API Guru]" <andrew.leac...@googlemail.com>
Date: Wed, 30 Apr 2008 16:20:47 -0700 (PDT)
Local: Wed, Apr 30 2008 7:20 pm
Subject: Re: I'm an absolute beginner. Unable to run this script.
On Apr 30, 7:45 pm, Kel <gdw.mas...@gmail.com> wrote:

> Thanks much! Currently, I have not put it online. The browser that I
> use is Firefox.

You really should put it online -- you have a gmail account, use your
googlepages space.

However, if you're using Firefox, you shouldn't use IE-specific code.
You can't do this:
x=document.Group.grup.value;

Your HTML is wrong and you need to name the <select> object, not its
values. The "name" attribute needs to be unique and can't appear more
than once.

<select name="grup">
  <option value="1">...
etc

You need to declare the variable
var x = ...
because IE will break if you don't.

You can then do
var x = document.getElementById("grup").value;
which should work in any browser.

NB. This isn't tested. It might have been if you had put your code
online. Note also that this group isn't really for HTML and Javascript
tutorials. It's for help with the Maps API. Your mapping Javascript
looks ok, but it uses v1 code which is obsolete and you should use v2
code. Start again, with the API documentation and possibly Mike's
tutorial.

Andrew

http://code.google.com/apis/maps/documentation/index.html
http://code.google.com/apis/maps/documentation/reference.html
http://econym.googlepages.com/index.htm


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google