I have a form which I intercept with a event.preventDefault(); when it is submitted, until the result of a callback function is returned (to get the lat and lng of a postcode). Brief mockup below:
$(".form").click(function(){
event.preventDefault();
if(calculateLatLng($(".postcode").val())){
$(this).submit();
}
});
However, this form has two submit buttons each determining different methods in the php, how would I allow javascript to identify which button has been clicked to submit the form.
You could explicitly trigger the click event on the desired submit button: