code werkt niet

Status
Niet open voor verdere reacties.

maarten423

Gebruiker
Lid geworden
8 mrt 2008
Berichten
26
Goedemiddag helpers,

Helaas heb ik helemaal geen verstand van html codes.
Ik heb onderstaande code gevonden bij een taxibedrijf en een beetje gewijzigd.
Ik wil graag dat hij automatisch uitrekent wat het kost om een piano te verhuizen.
De formule vindt ik wel in de code; alleen het html gedeelte is wat lastig.
Kan iemand eens kijken of hier iets van te maken is. Alvast heel erg bedankt.
Hier volgt de code.
Vriendelijke groet,

Maarten

<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br--><strong>Verhuismijnpiano.</strong>nl&gt;

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key= ABQIAAAAFjGMd37qp2cnjj7vtZkuaBR_jae4U6hu_46tYn146USExer-oRQ-rqM1Gvx6bHdV4iocxLZK70GiFQ"></script><!-- type="text/javascript"> // --><script type="text/javascript">// <![CDATA[
function initialize() { if (GBrowserIsCompatible()) { // nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen.... // http://code.google.com/apis/maps/documentation/referen...tml#GDirections gdir = new GDirections(); GEvent.addListener(gdir,"load", set_distance); } } function setDirections(fromAddress, toAddress, locale) { // http://code.google.com/apis/maps/documentation/referen...rectionsOptions gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} ); } function set_distance() { // extra: foutafhandeling, kan handig zijn!!! handleErrors(); // document.getElementById("afstand").innerHTML = (gdir.getDistance().meters); var adl_afstand = gdir.getDistance().meters var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5 prijs = Math.round(prijsOnafgerond + 0.5) prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2) document.getElementById("ritprijs").innerHTML = prijsEuro; } // aantal kilometers - 2 *2.2+150= prijs function handleErrors() { // http://code.google.com/apis/maps/documentation/referen...#GGeoStatusCode if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS) alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS) alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES) alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code); }
// ]]></script>

<!-- body { background-color: #5f5f5f; color: #fff; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; } #rittabel { border: } #ritprijs { font-weight: bold; font-size: 14px; color: #fff; } #euro { text-align: right; font-size: 13px; } #tableprijs { padding-top: 15px; } #rights { font-size: 9px; color: #ccc; } h1 { font-size: 16px; font-weight: bold; } -->

<form action="#" enctype="application/x-www-form-urlencoded" method="get">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<h1>Verhuismijnpiano kosten berekenen</h1>
</td>
</tr>
<tr>
<td colspan="2">Via het onderstaande formulier kunt u berekenen wat de verhuizing gaat kosten. Deze prijs is gebaseerd op een verhuizing van de begane grond naar de begane grond.</td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van het ophaaladres in: </td>
<td valign="top"><input id="fromAddress" name="from" size="30" type="text" value="Leeuwendalersweg, Amsterdam" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van aankomst in: </td>
<td valign="top"><input id="toAddress" name="to" size="30" type="text" value="bijv.: 1061 BH, 103" /></td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" value="Bereken verhuisprijs!" tabindex="1" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2">
<table id="tableprijs" border="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
 
vriendelijke groet codes in box te dumpen
gebruik daat voor de tag
Code:
 rondom geselecteerde tekst plaatsen 
  dan  is  wat leesbaarde   teken #   boven  in  bij   berichten maken  is dat 
zou fijn   als  je  er  dan  precies  bij  verteld  waar  het  fout  gaat
 
Het spijt me, Ciske. Ik begrijp niet helemaal wat je bedoeld met de tag in de box.
Het volgende gaat in ieder geval fout.
Ik heb de code even op mijn website geplaatst. http://www.verhuismijnpiano.nl/?page_id=27
Als ik dan op"bereken verhuisprijs" klik, geeft hij aan dat de pagina niet gevonden kan worden.
 
code

zie hier code

Code:
<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br--><strong>Verhuismijnpiano.</strong>nl&gt;

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key= ABQIAAAAFjGMd37qp2cnjj7vtZkuaBR_jae4U6hu_46tYn146USExer-oRQ-rqM1Gvx6bHdV4iocxLZK70GiFQ"></script><!-- type="text/javascript"> // --><script type="text/javascript">// <![CDATA[
function initialize() { if (GBrowserIsCompatible()) { // nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen.... // http://code.google.com/apis/maps/doc...ml#GDirections gdir = new GDirections(); GEvent.addListener(gdir,"load", set_distance); } } function setDirections(fromAddress, toAddress, locale) { // http://code.google.com/apis/maps/doc...ectionsOptions gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} ); } function set_distance() { // extra: foutafhandeling, kan handig zijn!!! handleErrors(); // document.getElementById("afstand").innerHTML = (gdir.getDistance().meters); var adl_afstand = gdir.getDistance().meters var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5 prijs = Math.round(prijsOnafgerond + 0.5) prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2) document.getElementById("ritprijs").innerHTML = prijsEuro; } // aantal kilometers - 2 *2.2+150= prijs function handleErrors() { // http://code.google.com/apis/maps/doc...GGeoStatusCode if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS) alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS) alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES) alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code); }
// ]]></script>

<!-- body { background-color: #5f5f5f; color: #fff; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; } #rittabel { border: } #ritprijs { font-weight: bold; font-size: 14px; color: #fff; } #euro { text-align: right; font-size: 13px; } #tableprijs { padding-top: 15px; } #rights { font-size: 9px; color: #ccc; } h1 { font-size: 16px; font-weight: bold; } --> 

<form action="#" enctype="application/x-www-form-urlencoded" method="get">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<h1>Verhuismijnpiano kosten berekenen</h1>
</td>
</tr>
<tr>
<td colspan="2">Via het onderstaande formulier kunt u berekenen wat de verhuizing gaat kosten. Deze prijs is gebaseerd op een verhuizing van de begane grond naar de begane grond.</td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van het ophaaladres in: </td>
<td valign="top"><input id="fromAddress" name="from" size="30" type="text" value="Leeuwendalersweg, Amsterdam" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van aankomst in: </td>
<td valign="top"><input id="toAddress" name="to" size="30" type="text" value="bijv.: 1061 BH, 103" /></td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" value="Bereken verhuisprijs!" tabindex="1" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2">
<table id="tableprijs" border="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
 
ik heb niks aan script gedaan
maar mijn vraag was kun je die html code van jou niet ff wat neter weg zetten
aangezien het geen gezicht zoon lange tekst codes
 
en om ff verder uit de droom te helpen op een of andere manier moet hij kilometers reekenen
als ik op bereken druk zie ik een url als # dit is niks
je moet gaan zoeken in dat script of het toale script pikken zo ken ik er weing mee aan gezien er gebruikt wordt gemaakt van google om de kilometers te bepalen
 
Aha, dat kreeg ik dus niet voor elkaar. Het is idd wat duidelijker in het kader.
 
Dit is het hele script, Ciske.
Ik heb je haakjes er omheen gezet, maar veel mooier wordt ie niet.



[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>ADL Taxi ritprijs bereken module</title>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Bereken uw ritprijs">
<meta name="keywords" content="afstand, berekening, kosten, twee, plaatsen, postcode, tabel, distance, calculation, adltaxi">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQ IAAAAnuJR4LRoDzUr6UAzMKz5qhSST5iocg_mE_TutLwEIp8h7 JhN4RTp8mZ_GDWg-LQtzI9 Z-vrKrKZR5A" type="text/javascript"></script>
<script type="text/javascript">
function initialize()
{
if (GBrowserIsCompatible())
{
// nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen....
// http://code.google.com/apis/maps/doc...ml#GDirections
gdir = new GDirections();
GEvent.addListener(gdir,"load", set_distance);
}
}

function setDirections(fromAddress, toAddress, locale)
{
// http://code.google.com/apis/maps/doc...ectionsOptions
gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} );
}

function set_distance()
{
// extra: foutafhandeling, kan handig zijn!!!
handleErrors();
// document.getElementById("afstand").innerHTML = (gdir.getDistance().meters);

var adl_afstand = gdir.getDistance().meters

var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5

prijs = Math.round(prijsOnafgerond + 0.5)



prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2)

document.getElementById("ritprijs").innerHTML = prijsEuro;
}

// aantal kilometers - 2 *2.2+7.5= prijs

function handleErrors()
{
// http://code.google.com/apis/maps/doc...GGeoStatusCode
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS)
alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_KEY)
alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS)
alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS)
alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES)
alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code);
}

</script>

<style type="text/css">
body {
background-color: #5f5f5f;
color: #fff;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 11px;
line-height: 18px;

}

#rittabel {
border:
}

#ritprijs {
font-weight: bold;
font-size: 14px;
color: #fff;
}

#euro {
text-align: right;
font-size: 13px;
}
#tableprijs {
padding-top: 15px;
}
#rights {
font-size: 9px;
color: #ccc;
}
h1 {
font-size: 16px;
font-weight: bold;
}

</style>

</head>
<body onload="initialize()" onunload="GUnload()">
<form action="#" onsubmit="setDirections(this.from.value, this.to.value, 'nl'); return false">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tr>
<td colspan="2">
<h1>Business Taxi 4You ritprijs berekenen</h1>
</td>
</tr>

<tr>
<td colspan="2">
Via het onderstaande formulier kunt u berekenen wat de taxirit ongeveer gaat kosten. Deze prijs is gebaseerd op een luxe voertuig met 4 zitplaaten.Voor busvervoer gelden andere tarieven.
</td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>Voer uw postcode, adres of plaats van vertrek in: &nbsp;</td>

<td valign="top"><input type="text" size="30" id="fromAddress" name="from" value="Leeuwendalersweg, Amsterdam" onblur="if(this.value=='') this.value='Leeuwendalersweg, Amsterdam';" onFocus="if(this.value=='bijv.: Leeuwendalersweg, Amsterdam') this.value='';"/></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>Voer uw postcode, adres of plaats van aankomst in:&nbsp;</td>
<td valign="top"><input type="text" size="30" id="toAddress" name="to" value="bijv.: 1061 BH, 103" onblur="if(this.value=='') this.value='bijv.: Schiphol';" onFocus="if(this.value=='bijv.: 1061 BH, 103') this.value='';"/></td>
</tr>
<tr>

<td>&nbsp;</td>
<td><input tabindex="1" name="submit" type="submit" value="Bereken ritprijs!" /></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
<table border="0" width="100%" id="tableprijs">
<tr>
<td><div id="ritprijs"></div></td>
</tr>
<tr>

<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</table>
</td>
</tr>
</table>
</form>]
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>ADL Taxi ritprijs bereken module</title>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Bereken uw ritprijs">
<meta name="keywords" content="afstand, berekening, kosten, twee, plaatsen, postcode, tabel, distance, calculation, adltaxi">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQ IAAAAnuJR4LRoDzUr6UAzMKz5qhSST5iocg_mE_TutLwEIp8h7 JhN4RTp8mZ_GDWg-LQtzI9 Z-vrKrKZR5A" type="text/javascript"></script>
<script type="text/javascript">
function initialize()
{
if (GBrowserIsCompatible())
{
// nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen....
// http://code.google.com/apis/maps/doc...ml#GDirections
gdir = new GDirections();
GEvent.addListener(gdir,"load", set_distance);
}
}

function setDirections(fromAddress, toAddress, locale)
{
// http://code.google.com/apis/maps/doc...ectionsOptions
gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} );
}

function set_distance()
{
// extra: foutafhandeling, kan handig zijn!!!
handleErrors();
// document.getElementById("afstand").innerHTML = (gdir.getDistance().meters);

var adl_afstand = gdir.getDistance().meters

var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5

prijs = Math.round(prijsOnafgerond + 0.5)



prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2)

document.getElementById("ritprijs").innerHTML = prijsEuro;
}

// aantal kilometers - 2 *2.2+7.5= prijs

function handleErrors()
{
// http://code.google.com/apis/maps/doc...GGeoStatusCode
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS)
alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_KEY)
alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS)
alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS)
alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES)
alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code);
}

</script>

<style type="text/css">
body {
background-color: #5f5f5f;
color: #fff;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 11px;
line-height: 18px;

}

#rittabel {
border:
}

#ritprijs {
font-weight: bold;
font-size: 14px;
color: #fff;
}

#euro {
text-align: right;
font-size: 13px;
}
#tableprijs {
padding-top: 15px;
}
#rights {
font-size: 9px;
color: #ccc;
}
h1 {
font-size: 16px;
font-weight: bold;
}

</style>

</head>
<body onload="initialize()" onunload="GUnload()">
<form action="#" onsubmit="setDirections(this.from.value, this.to.value, 'nl'); return false">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tr>
<td colspan="2">
<h1>Business Taxi 4You ritprijs berekenen</h1>
</td>
</tr>

<tr>
<td colspan="2">
Via het onderstaande formulier kunt u berekenen wat de taxirit ongeveer gaat kosten. Deze prijs is gebaseerd op een luxe voertuig met 4 zitplaaten.Voor busvervoer gelden andere tarieven.
</td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>Voer uw postcode, adres of plaats van vertrek in: &nbsp;</td>

<td valign="top"><input type="text" size="30" id="fromAddress" name="from" value="Leeuwendalersweg, Amsterdam" onblur="if(this.value=='') this.value='Leeuwendalersweg, Amsterdam';" onFocus="if(this.value=='bijv.: Leeuwendalersweg, Amsterdam') this.value='';"/></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>Voer uw postcode, adres of plaats van aankomst in:&nbsp;</td>
<td valign="top"><input type="text" size="30" id="toAddress" name="to" value="bijv.: 1061 BH, 103" onblur="if(this.value=='') this.value='bijv.: Schiphol';" onFocus="if(this.value=='bijv.: 1061 BH, 103') this.value='';"/></td>
</tr>
<tr>

<td>&nbsp;</td>
<td><input tabindex="1" name="submit" type="submit" value="Bereken ritprijs!" /></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
<table border="0" width="100%" id="tableprijs">
<tr>
<td><div id="ritprijs"></div></td>
</tr>
<tr>

<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</table>
</td>
</tr>
</table>
</form> [/QUOTE]
 
sorry, ik krijg het niet voor elkaar

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>adl taxi ritprijs bereken module</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="bereken uw ritprijs">
<meta name="keywords" content="afstand, berekening, kosten, twee, plaatsen, postcode, tabel, distance, calculation, adltaxi">
<meta http-equiv="content-type" content="text/html; charset=utf-8">


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=abq iaaaanujr4lrodzur6uazmkz5qhsst5iocg_me_tutlweip8h7 jhn4rtp8mz_gdwg-lqtzi9 z-vrkrkzr5a" type="text/javascript"></script>
<script type="text/javascript">
function initialize()
{
if (gbrowseriscompatible())
{
// nieuw object zonder parameters, want we willen nl. Geen geschreven route en geen map tonen....
// http://code.google.com/apis/maps/doc...ml#gdirections
gdir = new gdirections();
gevent.addlistener(gdir,"load", set_distance);
}
}

function setdirections(fromaddress, toaddress, locale)
{
// http://code.google.com/apis/maps/doc...ectionsoptions
gdir.load("from: " + fromaddress + " to: " + toaddress, {locale: Locale, travelmode:g_travel_mode_driving,avoidhighways: False} );
}

function set_distance()
{
// extra: Foutafhandeling, kan handig zijn!!!
Handleerrors();
// document.getelementbyid("afstand").innerhtml = (gdir.getdistance().meters);

var adl_afstand = gdir.getdistance().meters

var prijsonafgerond = (((adl_afstand/1000)-2)*2.2)+7.5

prijs = math.round(prijsonafgerond + 0.5)



prijseuro = 'de geschatte ritprijs is: € ' + prijs.tofixed(2)

document.getelementbyid("ritprijs").innerhtml = prijseuro;
}

// aantal kilometers - 2 *2.2+7.5= prijs

function handleerrors()
{
// http://code.google.com/apis/maps/doc...ggeostatuscode
if (gdir.getstatus().code == g_geo_unknown_address)
alert("no corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nerror code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_server_error)
alert("a geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_missing_query || gdir.getstatus().code == g_geo_missing_address)
alert("the http q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_bad_key)
alert("the given key is either invalid or does not match the domain for which it was given. \n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_bad_request)
alert("a directions request could not be successfully parsed.\n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_unavailable_address)
alert("the geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_unknown_directions)
alert("the gdirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n error code: " + gdir.getstatus().code);
else if (gdir.getstatus().code == g_geo_too_many_queries)
alert("the given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n error code: " + gdir.getstatus().code);
}

</script>

<style type="text/css">
body {
background-color: #5f5f5f;
color: #fff;
font-family: Verdana, arial, helvetica, sans-serif;
font-size: 11px;
line-height: 18px;

}

#rittabel {
border:
}

#ritprijs {
font-weight: Bold;
font-size: 14px;
color: #fff;
}

#euro {
text-align: Right;
font-size: 13px;
}
#tableprijs {
padding-top: 15px;
}
#rights {
font-size: 9px;
color: #ccc;
}
h1 {
font-size: 16px;
font-weight: Bold;
}

</style>

</head>
<body onload="initialize()" onunload="gunload()">
<form action="#" onsubmit="setdirections(this.from.value, this.to.value, 'nl'); return false">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tr>
<td colspan="2">
<h1>business taxi 4you ritprijs berekenen</h1>
</td>
</tr>

<tr>
<td colspan="2">
via het onderstaande formulier kunt u berekenen wat de taxirit ongeveer gaat kosten. Deze prijs is gebaseerd op een luxe voertuig met 4 zitplaaten.voor busvervoer gelden andere tarieven.
</td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>voer uw postcode, adres of plaats van vertrek in: &nbsp;</td>

<td valign="top"><input type="text" size="30" id="fromaddress" name="from" value="leeuwendalersweg, amsterdam" onblur="if(this.value=='') this.value='leeuwendalersweg, amsterdam';" onfocus="if(this.value=='bijv.: Leeuwendalersweg, amsterdam') this.value='';"/></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
</td>
</tr>
<tr>
<td>voer uw postcode, adres of plaats van aankomst in:&nbsp;</td>
<td valign="top"><input type="text" size="30" id="toaddress" name="to" value="bijv.: 1061 bh, 103" onblur="if(this.value=='') this.value='bijv.: Schiphol';" onfocus="if(this.value=='bijv.: 1061 bh, 103') this.value='';"/></td>
</tr>
<tr>

<td>&nbsp;</td>
<td><input tabindex="1" name="submit" type="submit" value="bereken ritprijs!" /></td>
</tr>
<tr>
<td colspan="2" style="height: 20px;">
<table border="0" width="100%" id="tableprijs">
<tr>
<td><div id="ritprijs"></div></td>
</tr>
<tr>

<td id="rights">aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
[/quote]
 
ik gok dat je op je index pagina een switch hebt staan die pagina's includes
Voor de switch voor denk ik gebruik gemaakt van de page_id=27 variabele in de url.
En als je op berekenen klikt, dan staat die variabele niet in de url, dus de switch kan geen pagina weegeven.
 
Gaat uberhaupt niet werken als je niet zelf een api key aanvraagt bij Google....
 
Dit werkt voor mij okok niet meer

Inderdaad dat zal niet werken want de api key is de mijne. Blijkbaar heeft iemand de code van mijn formulier gewoon klakkeloos gecopieerd. Maar mijn vraag is, hoe kan ik een api key vragen want blijkbaar gebruikt google die niet meer en ik heb mijn domein veranderd. De pagina werkt perfect in mijn locale browser maar niet online. Toch een beetje vreemd.
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan