CHtml::ajaxSubmitLink() ?


yii got these nice helpers in CHtml, like ajaxSubmitButton().

Is there something to generate the same functionality, but with a link, like ajaxSubmitLink()?

Best regards,


I don’t understand what the difference would be. The submit would be almost invisible for the user so why not use ajaxsubmit button?

I don’t want a button, it looks ugly ;)

I agree…so I use CSS to change the way it looks…works perfectly

I made this function that works like a ajaxSubmitLink

public static function ajaxSubmitLink($text,$url='#',$ajaxOptions,$htmlOptions=array()) {

  $ajaxOptions['type'] = 'POST';

  return self::ajaxLink($text, $url, $ajaxOptions, $htmlOptions);


In the way that jquery and yii works, this will submit the actual form via ajax and you can put css directy to the a tag!

Hope it’s helps!

Hi there - noob question - how would I make this function accessible anywhere in Yii?