Jquery validation bug with ajax

Hi guys,

I’m using the validate plugin from Jquery to be sure that the datas submitted will not be empty.

Everythings worked fine , but as soon a i changed


CHtml::submitButton('Submit')

to




 CHtml::ajaxSubmitButton('Submit',CController::createUrl('book/add'),array(

			  'update'=>'#book-div',

			  'cache'=>true,

              'beforeSend' => 'function(){

                $("#book-div").addClass("loading");}',

              'complete' => 'function(){

                $("#book-div").removeClass("loading");}',

            ),

           array(

              'id'=>'ajax-book-button',

           )

          )



, the validation is ignored.

Do you have an idea how can i keep the validation working even with the Ajax Submit Button ?

Thanks

i have the same issue still can’t resolve it

No one can solve this issue ?? :huh:

You should not use a ajaxbutton, but the standard submit of the form.

Take inspiration from this wiki: it use the gii generated form and a bit of js for do the submission via ajax correctly.

Simply ignore the part about dialog.