Answer the question
In order to leave comments, you need to log in
How to change the value and url of ajax itself in ajaxSubmitButton?
echo CHtml::ajaxSubmitButton
(
$model->isNewRecord ? 'Добавить номера' : 'Обновить',
Yii::app()->createUrl('sadmin/hotels/ajaxCreate'),
[
'type'=>'POST',
'data'=>'js:$("#hotels-form").serialize()',
'success'=>'js:function(data)
{
$("#crud-hotel").empty();
$("#crud-hotel").append(data);
setLocation("update/id/'.$model->id.'");
}',
],
[
'id'=>'add-hotel',
'class'=>'btn btn-primary btn-lg center-block',
]
$("#add-hotel").value("Новое значение");
Answer the question
In order to leave comments, you need to log in
Yii::app()->createUrl('sadmin/hotels/'. $model->isNewRecord ? 'ajaxCreate' : 'ajaxUpdate'),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question