我正在开发一个涉及计算运费的谷歌地图的项目。我把它编码出来,它显示在WordPress页面中,但提交按钮不起作用。
这个的正确功能假设如下:
但截至目前,该页面只是重新加载,并且不会显示任何送货费用或指示。
<script type="text/javascript">
// <![CDATA[
window.onload = function() {
initialize(61.5705194, -149.118133);
}
// ]]>
</script>
<input id="day_more_five" type="hidden" value="2" />
<input id="day_less_five" type="hidden" value="0" />
<input id="night_more_five" type="hidden" value="10" />
<input id="night_less_five" type="hidden" value="10" />
<script type="text/javascript">
// <![CDATA[
function get_distance(form) {
from = form.place_from.value;
to = form.place_to.value;
calcRoute(from, to);
}
// ]]>
</script>
<div id="abgdc-wrap">
<div id="map_canvas" style="position: relative; width: 100%px;
height: 600px; margin: 0px auto; border: solid 5px #003;"></div>
<form action="" method="post" name="form1">
<table class="abgdc-table">
<tbody>
<tr>
<td>From:
<input class="txt" disabled="disabled" name="place_from" type="text" value="FROM ADDRESS GOES HERE" />
</td>
/tr>
<tr>
<td> To:
<input class="txt" name="place_to" type="text" />
</td>
</tr>
<tr style="display: none;">
<td>Travel Time:
<input id="day_time" style="display: none;" checked="checked" name="travel_time" type="radio" value="day" /> Day
<input id="night_time" style="display: none;" name="travel_time" type="radio" value="night" /> Night</td>
</tr>
<tr>
<td>
<input style="width: 100%!important;"
type="button"
value="Get Quote"
onclick="get_distance(this.form)" />
<input id="map_zoom" type="hidden" value="7" />
<input id="curr_format" type="hidden" value="$" />
</td>
</tr>
</tbody>
</table>
</form>
<div id="distance"></div>
<div id="steps"></div>
</div>