ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
TinyMCE Won't Save
Title:
B
I
{code}
?
http://aspnetawesome.com/forum/question/513/tinymce-html-editor-on-popupform I referenced this post but am still unable to get it working. If the TinyMCE textbox is empty, the save works. If I have any text in there and I click submit, it doesn't do anything and doesn't throw any javascript errors. @using (Html.BeginForm()) { @Html.TextAreaFor(o => o.Comments) <script> (function () { var id = "Comments"; tinymce.init({ selector: '#' + id }); $('#' + id).closest('form').submit(function () { tinymce.triggerSave(); }); $('#' + id).closest('.ui-dialog').on('dialogbeforeclose', function () { tinymce.get(id).destroy(); }); })(); </script> }
Save Changes
Cancel
rsnider19
asked at 15 Apr 2014
this is supposed to be a tinymce attached to a textarea that is inside a popupform, is this your case ?
at 15 Apr 2014
Omu
Yes, it is in the Create popup for a grid. Sorry I forgot to mention that.
at 16 Apr 2014
rsnider19
works for me using version 4.0, if you can't get it working create a sample solution using trial version, upload it and post the link here
at 16 Apr 2014
Omu
i just tried it with your AwesomeMVCDemo and it didn't work there either. I installed TinyMCE through NuGet. I don't know if that makes a difference.
at 16 Apr 2014
rsnider19
Answers
B
I
{code}
?
.NET was't trusting the html to save. I just had to add the AllowHtml data annotation to the property: [AllowHtml] [DisplayName("Comments")] public string Comments { get; set; }
Save Changes
Cancel
rsnider19
answered at 16 Apr 2014
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK