imageButton problem - yii 1.1.5


after updating from 1.1.2 to 1.1.5 the ajax is ignored.

the page refresh itself when i click it.

CHtml::imageButton(‘images/ShowAns.png’, array(“id”=>rand(),“class”=>“CheckAns”,

		'ajax' => array(

		'type'=>'POST', //request type

		'url'=>'?r=exercise/ShowAns&rand='.rand().'&ansId='.$this->ansId, //url to call

		'update'=>'#table'.$this->ansId, //selector to update

		 'beforeSend' => 'function(){




That’s probably due to the jQuery update.

Check the syntax.

Also, try wrapping the script in ‘js’, like this:


sorry, i didn’t understand what you mean.

but hear a strange thing. it works on Chrome and IE but not on FireFox :\

any idea?

Try using the controller createUrl function for the url.

Like ‘$this->createUrl(whatever, array(parameters));’

I meant to say that the version of jQuery has been updated by Yii 1.1.5.

nop…it doesn’t work.

the form sent as if i didn’t put the AJAX parameter at all…

sorry about my bad english.