Forums

Confused with "On submit code"

CHIESA 17 May, 2010
Hello,
I think that i don't understand how to use "On submit code" ...
I have a form with an address fields and two hidden fields, 'latitude' and 'longitude'.
I would like to use GMap service to fill my hidden fields.
I put in "On submit code" then following snippet :
<?php
$lat = $_POST('latitude');
$long = $_POST('longitude');
$add = $_POST('address');
geocode($add, &$lat, &$long); // my routine wich works ordinary fine
$_POST('latitude') = $lat;
$_POST('longitude') = $long;
?>
Nothing works and i receive a message : "Parse error: syntax error, unexpected '=' in /.../components/com_chronocontact/libraries/customcode.php(64) : eval()'d code on line 6

Have you any idea ? where can i find some doc/sample for this functionnality ?

Thank you, and excuse me for my poot english. i'm a damned froggie :-)
GreyHead 18 May, 2010
Bonjour Chiesa,

The OnSubmit box works just as you have used it. You are seeing a PHP error reported at line 6 which suggest that there maybe something wrong before that. Line 6 looks OK but in line 5 the geocode() function isn't defined in this code so I suspect that line is failing.

You probably need to include the geocode() function somehow?

Bob
This topic is locked and no more replies can be posted.