jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Editor › replacing textarea with editor breaks post
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 7 months ago.
-
Author
-
Hello, maybe I’m doing something wrong but I replaced all my textarea controls with editors (MVC 5 app) and now nothing posts from the form with these. The same name is used for both. Am I missing something? Here is some code below. Thanks
<div class=”form-group”>
@Html.LabelFor(model => model.Description, new { @class = “control-label col-md-2″ })
<div class=”col-md-10”>
@Html.TextAreaFor(model => model.Description)
@Html.ValidationMessageFor(model => model.Description)
</div>
</div>$(“#Description”).jqxEditor({
height: “40%”,
tools: ‘bold italic underline | left center right|outdent indent | ul ol|link | clean | html ‘,
width: ‘80%’, theme: themeChoice, toolbarPosition: “bottom”
});Hi godbrain,
You should use Ajax if you want to POST editor’s data. It’s val() method can be used for getting its value.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/But I’m just posting it with the rest of the form… Thats the only way to get the value? Hmm Maybe I won’t even use this then. I was using CLeditor and that had worked easily.
Thanks
Hi godbrain,
Ok, if you do not want to post your data through Ajax, I cannot give you another solution.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi peter, Would it be possible to just show some quick code on sending an example contact form through Ajax with your controls in MVC 5? Like a textbox, dropdown and your editor control? Then maybe I could see the point of doing it this way…
Thanks
Hi godbrain,
You can use jQuery’s Ajax or better jQuery’s post function for sending data from a client to a server. jQuery post is a shorthand of the jQuery’s Ajax function and you can learn more about it here: http://api.jquery.com/jquery.post/. Most of the editing widgets have “val” method which you can use for getting the current value.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.