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>