4

I am using submit handler in jQuery to validate the form before it passed to the Salesforce action function for submission, which in Firefox works perfectly.

Yet in Chrome, the submission gets to the iQuery function to validate the form and passes validation (checked with an alert box) but does not then continue to submit via the Action Function, instead the page silently refreshes with no error messages (neither javascript console or debug logs).

Here is the form:

<apex:form Id="form" > 

<input type="submit" value="submit" id="subBtn" name="subBtn" />
<apex:actionFunction name="doSubmit" action="{!submit}" />

</apex:form>

And here is the jQuery function:

$("[id$=form]").validate({
             submitHandler: function(form) {
                doSubmit();
              }
        });  

Anyone know why this might be happening? Or a workaround?

3

You need to set a return value of false on complete of the actionFunction

try:

<apex:actionFunction name="doSubmit" action="{!submit}" oncomplete="return false;" />
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.