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>