Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Get innerHTML value from dynamically generated textbox MVC5
Mani Kandan
Jan 20 2017 4:01 AM
292
Reply
Hello everyone,
I am creating a dynamic table with textbox and multiple images by input type file.
function
handleFileSelect(e) {
selDiv = document.querySelector(
"#dvPreview"
);
for
(
var
i = 0; i < fileList.length; i++) {
selDiv.innerHTML +=
"<tr><td><img src="
+ objectUrl +
" /></td><td>
<input id='txtImgdescription' type='text'/>
</td><td><input class='check_class' type='checkbox'/> <a onclick='delete_user($(this))'> X </a></td></tr>"
;
}
I want image description from textbox with respect to corresponding image. So I have done, after bind the table on .cshtml page there is model class, the I can not the value from view to controller.
I did tried write textbox like model=>model.Imgdescription
<
input
id
=
'txtImgdescription'
type
=
'text'
/>
instead of
<
td
>
@Html.TextAreaFor(
model
=
>
model.Imgdescription)
</
td
>
but nothing happened. Then view look like this,
Please help me...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
chk the code n give suggestion ?
get path of SqlLite database those ara created by javascript