0
난 다음보기가 : -MVC 응용 프로그램
<div id = "partialWrapper">
@using (Ajax.BeginForm("Create", "Answer", new AjaxOptions
{
HttpMethod = "Post",
InsertionMode = InsertionMode.InsertAfter,
UpdateTargetId = "incrementanswer",
OnSuccess = "removePartial"
}))
{
<div id = "returnedquestion">
@Html.ValidationSummary(true)
<fieldset>
<legend>Answer here</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Description)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Description)
@Html.ValidationMessageFor(model => model.Description)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.IsRight)
</div>
<div class="editor-field">
@Html.DropDownList("IsRight", String.Empty)
@Html.ValidationMessageFor(model => model.IsRight)
</div>
</fieldset>
<input type= "hidden" name = "questionid" value = @ViewBag.questionid>
<input type= "hidden" name = "assessmentid" value = @ViewBag.assessmentid>
<input type="submit" value="Add answer" />
</div>
}
</div>
내가되도록 필드 내부의 모든 데이터를 지우려면을 사용자가 쉽게 새로운 개체를 추가 할 수 있습니다, 내가 시도 다음 그러나이 텍스트와 필드를 제거합니다 : -
function removePartial() {
$("#partialWrapper").remove();
}
및
function removePartial() {
$("#partialWrapper").empty();
}
필드 자체를 제거하지 않고 Div 내의 모든 필드 내부의 텍스트를 지울 수있는 방법이 있습니다. BR
일이 그것이 * 리셋 *'영업의 의도로 나타나는, fields' 숨겨지지 바와 같이, 이상적인 방법입니다. – xandercoded
감사합니다. –