java - jsf ajax trigged after jquery validation function -


i'm facing problem within jsf ajax request , jquery event.

i'm using jquery event validate form part :

    jquery(".btnnextstep").live("click", function(e) {     var error = !validate(id);             ...     return error; 

and under same button, have 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 ajax request submited if jquery event return false !

how can request sent after jquery validation function ?

i have tried onevent on f:ajax seem it's not possible call function inside of jquery namespace:

 (jquery(document).ready( function() {...) 

i hope understand problem. thanks.

try define validate function :

function vlidatenextstep() {     var error = false;     error = !validate(id);             ...     return error; } 

and use on click:

<h:commandbutton type="button" value="etape suivante" class="btn btn-large btn-primary btnnextstep" id="btnformidentite" onclick="return vlidatenextstep();">     <f:ajax execute="identite" render="@none" /> </h:commandbutton> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -