2017-11-06 10 views
0

を仕事と私はまた、必要なフィールドを割り当てているが、検証は働いていません: -ASP.Net MVC 5 CKEditorバージョンAllowHtml RequiredAttribute私のモデルが好きで、私は私のモデルにCKEditorバージョンのためAllowHtmlを使用しています

[Display(Name = "Introduction Details:")] 
    [Required(ErrorMessage = "Introduction Details is required.")] 
    [AllowHtml] 
    public string Introduction { get; set; } 
+0

バリデータを再設定する必要があります - [この回答](https://stackoverflow.com/questions/26379307/jquery-chosen-dropdown-validation-client-site-doesnt-work/26392882#26392882) –

+0

をご覧くださいこの投稿はhttps://stackoverflow.com/questions/4491316/ckeditor-and-asp-net-mvc-3-requiredattribute –

答えて

0
<script type="text/javascript"> 
    $(document).ready(function() { 
     $('#CkEditor1').ckeditor(); 
     $('#Testimonials_error').hide(); 

    }); 
    function GetCKEditorData() { 
     var data = $('#CkEditor1').val(); 
     if (data != "") { 
      var c = confirm("Do you want to save this record"); 
      if (c) { 
       window.location.href = "/Admin/Testimonials"; 
      } 
     } 
     else { 
      $('#Testimonials_error').show(); 
      return false; 
     } 
    } 
</script> 
+0

フォームクリックイベント(OnBegin = "return GetCKEditorData()"でOnBeginメソッドを使用) – Tejas

関連する問題