I'm trying to use the TinyMCE editor in an MVC3 project of mine. I have it displaying and working fine in the browser but can't get the data in it to postback with the form.
My view (snippet):
<div class="formRow">
<div class="formFieldFull">
<div class="editor-label">
@Html.LabelFor(model => model.Conditions)
</div>
<div class="large-multiline-field" style="width:396px;">
@Html.EditorFor(model => model.Conditions)
</div>
<div class="validationMsg">
@Html.ValidationMessageFor(model => model.Conditions)
</div>
</div>
</div>
Without TinyMCE, the Conditions field will render as a textarea. With TinyMCE it overlays that textarea with its own stuff and that seems to be where the problem is. The original textarea is there but it has been set to display:none. TinyMCE has made put a copy of the field contents between some tags and that appears to be where the edited content resides. When I post the form back the original textarea still contains the field contents from the orignal response, not the edited content that should be passed back.
Here is what the rendered code looks like (in Firebug) with TinyMCE:
<div class="large-multiline-field" style="width:396px;">
<textarea id="Conditions" rows="2" name="Conditions" data-val-length-max="2000" data-val-length="Conditions must be under 2000 characters." data-val="true" cols="20" length="40" style="display: none;" aria-hidden="true">
----> ACTUAL CONTENT GOES HERE
</textarea>
<span id="Conditions_parent" class="mceEditor defaultSkin" role="application" aria-labelledby="Conditions_voice">
<span id="Conditions_voice" class="mceVoiceLabel" style="display:none;">Rich Text Area</span>
<table id="Conditions_tbl" class="mceLayout" cellspacing="0" cellpadding="0" role="presentation" style="width: 404px; height: 222px;">
<tbody>
<tr class="mceFirst" role="presentation">
TinyMCE Toolbars go here
</tr>
<tr class="mceLast">
<td class="mceIframeContainer mceFirst mceLast">
<iframe id="Conditions_ifr" frameborder="0" src="javascript:""" allowtransparency="true" title="Rich Text AreaPress ALT-F10 for toolbar. Press ALT-0 for help" style="width: 100%; height: 153px; display: block;">
<html>
----> EDITED CONTENT GOES HERE
</html>
</iframe>
</td>
</tr>
</tbody>
</table>
</span>
</div>
Is there something I should be doing to cause TinyMCE to update the original textarea with the edited content prior to postback?