TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kalyani Shevale
NA
3.2k
705k
How to get arraylist from formData in action mvc
Dec 4 2018 10:57 PM
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.
Reply
Answers (
2
)
in Jquery - DOM element uncheck the checkbox
How can i access form control in class file with in Project