Hide Div In Second Submit

I can populate hidden divs only after the first form submit. After the first submit the #out_put always opened.

My original codes




echo CHtml::ajaxSubmitButton(' SUBMIT ',

                        array('site/actionName'),

                        array(

                                'beforeSend' => 'function(){

                        $("#out_put").addClass("ajaxloading");}',

                        'complete' => 'function(){

                        $("#out_put").removeClass("ajaxloading");}',

                                'update'=>'#out_put',

                        ),

                        array('class'=>'btn btn-success span12')        

); 



I tried smthng like this but it’s not working


echo CHtml::ajaxSubmitButton(' SUBMIT ',

                        array('site/actionName'),

                        array(

                                'beforeSend' => 'function(){

                                $("#out_put").hide();

                        $("#out_put").addClass("ajaxloading");}',

                        'complete' => 'function(){

                                $("#out_put").show();

                                e.preventDefault();

                        $("#out_put").removeClass("ajaxloading");}',

                                'update'=>'#out_put',

                        ),

                        array('class'=>'btn btn-success span12')        

); 



Please help…

Thank you