我有TinyMCE编辑器的问题.我有几个文本字段和textarea(tinymce)的表单,并启用了客户端验证.当我单击保存按钮验证在所有文本字段上发生,但它需要2次单击以验证tinymce内容.此外,验证仅在字段为空时显示消息,或者如果条件不满足(仅针对测试原因,可以输入最多5个字符),但是当我输入正确的字符数(少于5个)时,错误消息将保留.
这是代码示例:
<%Html.EnableClientValidation(); %>
<%= Html.ValidationSummary(true, "Na stranici postoje greške.", new { @style = "color: red;" })%></p>
<% using (Html.BeginForm("Create", "Article", FormMethod.Post, new { enctype = "multipart/form-data" }))
{ %>
<fieldset>
<legend>Podaci za Aranžman</legend>
<label class="EditLabel" for="name">
Opis</label>
<br />
<%= Html.TextAreaFor(Model => Model.Description, new { style = "width: 100%; height: 350px;", @class = "tinymce" })%>
<%= Html.ValidationMessageFor(Model => Model.Description, "", new { @style = "color: red;" })%>
<p>
<input type="submit" value="Sa?uvaj aranžman" />
</p>
</fieldset>
<% } %>
Run Code Online (Sandbox Code Playgroud)
和财产 …