I have Used formData for getting values from Views. I have used one ArrayList in this ArrayList multiple parameters are used this ArrayList append in FormData object.
- var resultQuiz = [];
- var fileData = new FormData();
- $.each($('#imgInp')[0].files, function (i, file) {
- fileData.append('file-' + i, file);
- });
- $("input[name=chkbox]:checked").each(function (i) {
-
- var test = "textOther_" + $(this).attr('id');
- resultQuiz.push({
- Id: Id,
- Message: 'checkbox',
- selectedAnswerOptionID: $(this).attr('id'),
- isotherField: $("#" + test + "").val(),
-
- })
- });
- fileData.append('resultQuiz', resultQuiz);
- $.ajax({
- url: '@Url.Action("QuizTest", "Quizz")',
- data: fileData,
- processData: false,
- contentType: false,
- type: 'POST',
- success: function (data) {
- if (data == "Tagged") {
-
- }
- }
- });
how to access this arraylist in action.