on ajax success clear green css


first post :)

how do i clear the green row (class success) on ajax success.

many thanks

Can you paste the code you’re currently using? Either way, when the ajax call is successful (providing you’re using jQuery), it triggers a success() function (see: http://api.jquery.com/jQuery.ajax/). Within that function you’d just have to remove the success class, i.e.


  url: 'blah',

  success: function() {




Don’t try to use that code, as it won’t just plug in to what you currently have :P Hopefully though it should give you an idea.

The other solution would be to change the CSS rule… so that even if there is class “success” it’s not green

Thanks (Artificial)… thats the sort of thing that way i use the green as a reminder that the form is dirty and need submiting and thus cleared once sucessfull

I thought it a good practice to post the final code for others.

//make the form with unique id

<div class="form" id='group<?php echo $group->id_Group;?>'>

<?php $form = $this->beginWidget('CActiveForm', array(




    'clientOptions' => array(





)); ?>

	<?php echo $form->errorSummary($group); ?>

	<?php echo CHtml::hiddenField('form','group');?>

	<div class="row">

		<?php echo $form->labelEx($group,'groupName'); ?>

                <?php echo $form->textField($group,'groupName', array('style' => 'width: 581px')) ?>

		<?php echo $form->error($group,'groupName'); ?>


	<div class="row buttons">


		echo CHtml::ajaxSubmitButton(







				$('#group" . $group->id_Group . "').find('.row').removeClass('success');

				} ",






<?php $this->endWidget(); ?>

</div><!-- form -->