i have form where i have text box value and link (add). when user enteres data in to textbox and click add it should add entered text to textArea on the same view. I have tried doing this with ajax.actionlink but i can’t seem to figure out how too pass the entered text to parameter. can anyone have another idea that i can try..i can’t use Ajax.beginForm because i have html form already.
Thank you in advance.
here is html code that i have so far with ajax action link.
<div class="editor-label">
<%: Html.Label("DefectID / FeatureID")%> <%: Html.TextBox("DefectID", "", new { @class = "required" })%> <%: Ajax.ActionLink("Add", "InsertDefectIDs", new AjaxOptions { UpdateTargetId = "DefectIds" }) %><%--<input type="button" name="add" value="Add" />--%>
</div>
<div class="editor-field">
<%: Html.TextAreaFor(model => model.DefectIds, new { rows = 5, cols = 12, @readonly = "true" })%>
<%: Html.ValidationMessageFor(model => model.DefectIds)%>
</div>
You should be able to something like the following:
HTML
Javascript
Here is a straight html/javascript example: http://jsfiddle.net/zJpRA/6/