mortenstarck
mortenstarck

Reputation: 2803

Closing a dialog mvc3

I have en dialog box where there is an CKEditor inside. But i can't get it to fire the HTTPPost on the partialView.

 <form method="post" action="@Url.Action("Description")">
@Html.CKEditor("text", (string)ViewBag.BodyText, "toolbar:'Full'", new { cols = 2000, rows = 5000 })
<p>
<input type="submit"  value="@Resources.Resources.ProjectCreateDescriptionSave" onclick="@Html.CKEditorSubmitButtonUpdateFunction();" class="close"/>
</p>
</form>

It requires the class="close" but if it's in the input it closes but dosen't fire the httppost. But if i remove the class="close" it works prefect. IS there an way to combine them?

Upvotes: 2

Views: 209

Answers (1)

IAmGroot
IAmGroot

Reputation: 13855

I think you have a mistake in your click event.

onclick="@Html.CKEditorSubmitButtonUpdateFunction();"

Should read

onclick="CKEditorSubmitButtonUpdateFunction();"

Where CKEditorSubmitButtonUpdateFunction() is the name of your javascript function. There is no need for the appended @Html section.

Edit: and really you shouldnt need an onclick event there? Your form handles the post event action="@Url.Action("Description")"

Upvotes: 2

Related Questions