In my view I want to add the text user enter in a textarea to be added to my table.
User enter type in the text in a textarea and then click on a button and then the text appears into a table.
I have to following code in my view.
<p>Custom Question</p>
<div class="editor-field">
@Html.TextAreaFor(model => model.CustomQuestionText)
@Html.ValidationMessageFor(model => model.CustomQuestionText)
</div>
<div><p><input type="button" value="Lägg till" /></p></div>
</div>
And this is the table that I want the text to filled in:
<table id="CustomTable">
<thead><tr><th>Custom questions</th></tr></thead>
<tbody>
</tbody>
</table>
Any solutions with Jquery is appreciated, thanks in advance.
And here’s a live demo.