Answer the question
In order to leave comments, you need to log in
How to send form.serialize and other data in yii with ajax?
I need to send more data along with the form, an array, how to do it?
var mas = [5],
$.ajax({
type: 'POST',
data: form.serialize()+'&mas', // здесь мне нужно добавить массив правильно ли я сделал ?
dataType: 'json',
success: function (result) {
alert('Ok');
},
error: function () {
alert('Error');
}
});
Answer the question
In order to leave comments, you need to log in
form.serialize()+'&mas', // I need to add an array here, did I do it right?No, you did wrong. All you have done is add a get parameter named mas with no value. You need to loop through the correct get parameter. How it should look like I showed you in the previous question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question