2013-05-21 19 views
0

我正在使用jQuery.wysiwyg(https://github.com/akzhan/jwysiwyg)和MVC2。我怎樣才能得到textarea的價值?jquery.wysiwyg使用mvc2

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NotificationsViewModel>" %> 
<script> 
     $(document).ready(function(){ 
      $('#Message').wysiwyg(); 
     }); 
</script> 
<% using (Html.BeginForm("ManageNotifications", "Admin", FormMethod.Post)) 
{ %> 
    <table class="noborderverticalcenter" style="width:100%;"> 
    <tr> 
    <td>Message</td> 
    <td> 
     <%= Html.TextAreaFor(model => model.Message) %> 
    </td> 
    </tr> 
    </table> 
<% } %> 

回答

0

希望這是有益

var textContent=$("#textarea-id").wysiwyg('getContent'); 

這將會給ü文本包括HTML標籤

剝離HTML標記使用ethis

textContent=textContent.replace(/<\/?[^>]+(>|$)/g, "");