I'm facing a problem within JSF ajax request and jQuery Event.
I'm using jQuery event to validate a form part like this :
jQuery(".btnNextStep").live("click", function(e) {
var error = !validate(id);
...
return error;
and under the same button, I have an Ajax event :
<h:commandButton type="button" value="Etape suivante" class="btn btn-large btn-primary btnNextStep" id="btnFormIdentite">
<f:ajax execute="identite" render="@none" />
</h:commandButton>
The problem is that the ajax request is submited even if jQuery event return false !
how can I do so that the request is sent after the jquery validation function ?
I have tried the onEvent on f:ajax
but it seem that it's not possible to call a function inside of the jQuery namespace:
(jQuery(document).ready( function() {...)
I hope you understand my problem. Thanks.