[jQuery] calling a function before a form is submitted
Hi,
I'm trying to perform an action before a form is submitted using the
following snippet:
$('form').submit(function() {
updateMapFromFields();
return true;
});
but for some reasons the updateMapFromFields seems not to be executed.
If, instead, I execute the following code (with "return false" at the
end):
$('form').submit(function() {
updateMapFromFields();
return false;
});
I can see that the updateMapFromFields() works fine but, obviously,
the form isn't submitted (while I'd like it to be submitted somehow).
Am I supposed to do something else in order to perform an action
before the form is submitted?
Thanks a lot for your time, any help would be very appreciated.
Regards
Francesco