Ik ben bezig met google afstand berekening en ik kom er niet uit..
De afstand in Km staat in <div id="afstand"></div>
Nu wil ik de afstand in km omzetten naar $afstand omdat deze in een andere form overgenomen moet worden.
Form1:PHP Code:function set_distance()
{
// extra: foutafhandeling, kan handig zijn!!!
handleErrors();
document.getElementById("afstand").innerHTML = gdir.getDistance().html;
}
PHP Code:<form action="#" onsubmit="setDirections(this.locatieontv.value, this.locatiezndr.value, 'nl'); return false">
<table border="0">
<tr>
<td align = "right" ><font face="Verdana" size="2" color="********">Locatie Ontvanger :</font></td><td><input type="text" id="fromAddress" name="locatieontv" value=""/></td>
</tr>
<tr>
<td align = "right" ><font face="Verdana" size="2" color="********">Locatie Zender :</font></td><td><input type="text" id="toAddress" name="locatiezndr" value="" /></td>
<td><input tabindex="1" name="submit" type="submit" value="Bereken afstand!" /></td>
</tr>
</tr>
</table>
</form>
In form2 staat een regel en daar wil ik $afstand in verwerken
Hoe los ik dit op?PHP Code:<tr>
<td align = "right" ><font face="Verdana" size="2" color="********">Kilometer :</font></td>
<td><input type = "text" name = "kilometer" value = "<? echo $afstand; ?>"</td>
</tr>

Likes:


Quote
