AjaxSubmitButton : waiting effect

What I’m trying to do :

When I click to the ajaxSubmitButton, it will do an insert to database and I want I generate the text : “Importing” when It’s done : “Done”

What I’ve tried :


    echo CHtml::ajaxSubmitButton("Import",

            CController::createUrl('stock/UpdateAjax', array('dir' => $dir)),


                'update' => '#status'),

            array('id' => 'ajaxButton'));


I put this in a form and I have <div id=status></div> below :)

How about using ‘beforeSend’ and ‘complete’ options? Perhaps something like (not tested):







I think we should write ‘js:function() [the rest]’ instead of ‘function() [the rest]’ . I try this now and report later :)