1 包含jquery 复制代码 代码如下: <script src="images/jquery-1.2.6.min.js" type="text/javascript"></script> <script src="images/jquery.form.js" type="text/javascript"></script> 2 设置 <div id="msg"></div></td> 3 JAVASCRIPT设置 复制代码 代码如下: <script type="text/javascript"> <!-- $(function(){ $('#msg').hide(); var options = { target: '#msg', url: 'XXXX.ACTION', beforeSubmit: function(){ if($('#company').val()==''){ $('#msg').html("<span class="about_content_title">[公司名称]不能为空!</span>"); $('#msg').show(1000); $('#msg').hide(3000); return false; } $('#msg').html("<img src="images/loading.gif" /><span class="about_content_title"> 资料保存中,请稍候。。。</span>"); $('#msg').show(1000); } success: function() { $('#msg').html("<span class="about_content_title">资料保存成功!</span>"); $('#msg').show(1000); $('#myform').resetForm(); $('#msg').hide(3000); } }; $('#myform').ajaxForm(options); }); --> </script>
推荐阅读
jQuery与ExtJS之选择实例分析
Examples 下面是PHP中生成的表页: 复制代码 代码如下: <p><a href="<?= $this->url(array('controller'=>'contact', 'action'=>'add'));?>">Add new Contact</a></p> <table class="contactTable" id="contactTab>>>详细阅读
本文标题:jquery中输入验证中一个不错的效果
地址:http://www.17bianji.com/kaifa2/JS/25820.html
1/2 1