JQuery Validate & 富文本编辑

2 篇文章 0 订阅

1.       引用相关的JS文件

<script src="../../Scripts/fckeditor.js" type="text/javascript"></script>

<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>

2 $(document.forms.item(0)).validate({

            errorClass: "error",

            rules:

            {

                Title: "required",

                Content: "required"

            },

            messages:

            {

                Title: "*请输入新闻标题",

                Content: "*请输入新闻正文"

            }

 

        });

详细的使用方法参考: http://student.csdn.net/space.php?uid=42425&do=blog&id=8663

注意:页面元素的name不能为description,我怀疑是这个名字是做为关键字被jquery validate框架使用.

 

3富文本代码:

var oFCKeditor = new FCKeditor('description1');

         FCKeditor.ToolbarSet = "Wiki";

     oFCKeditor.ReplaceTextarea();

<div class="editor-field">

                版本说明

                <textarea rows="6" id="description1" name="description1"><%=Server.HtmlDecode(this.Model.description)%></textarea>

               

            </div>

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
jQuery Validate是一个流行的jQuery插件,用于在前端对表单进行验证。使用这个插件可以方便地添加各种验证规则,如必填字段、最小长度、邮箱格式等等,以确保用户输入的数据的准确性和完整性。 要使用jQuery Validate插件,首先需要在页面中导入相关的JavaScript文件。可以通过在HTML页面的&lt;head&gt;标签中添加以下代码来导入jQuery Validate插件文件: ```html &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.validate.min.js&quot;&gt;&lt;/script&gt; ``` 然后,可以通过调用validate()方法来对表单进行验证。在调用validate()方法时,可以传入一些配置选项来自定义验证规则和错误提示信息。详细的配置说明可以参考插件的官方文档,其中包括了各种可用的配置选项和示例代码: ```html 配置说明:http://docs.jquery.com/Plugins/Validation/validate#options ``` 如果需要获取更多关于jQuery Validate插件的信息,可以访问官方网站: ```html 官方网站:http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ``` 通过阅读官方文档和示例代码,您可以更好地了解如何使用jQuery Validate插件来实现表单验证功能。&lt;span class=&quot;em&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;em&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;em&quot;&gt;3&lt;/span&gt; #### 引用[.reference_title] - *1* *2* *3* [jQuery Validate 表单验证插件](https://blog.csdn.net/xiangxiao_bobo/article/details/119772293)[target=&quot;_blank&quot; data-report-click={&quot;spm&quot;:&quot;1018.2226.3001.9630&quot;,&quot;extra&quot;:{&quot;utm_source&quot;:&quot;vip_chatgpt_common_search_pc_result&quot;,&quot;utm_medium&quot;:&quot;distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1&quot;}}] [.reference_item style=&quot;max-width: 100%&quot;] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值