• 1226整理


    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>测试表单</title>
    
    
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="js/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="js/themes/icon.css">
    <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
    
    <script type="text/javascript" src="js/locale/easyui-lang-zh_CN.js"></script>
    
    <script type="text/javascript">
    
    $(function(){
        
        $("#myform").form({
            novalidate:false,
            url:'TestSubmit',
            onSubmit:function(){
                
                var isValid = $(this).form('validate');
                
                //alert('表单测试=' + isValid);
                
                if(!isValid)
                    {
                    $.messager.show({title:'表单验证',msg:'验证未通过'});
                    }
        
                return isValid;
            },
            success:function(data){    
                alert(data)    
            }    
    
        });
        
        $("#subbutton").click(function(){
            
            $("#myform").form('submit');
        });
        
    })
    
    </script>
    
    </head>
    <body>
    <div id="mypanel" class="easyui-panel" title="用户信息" style="300px;height:400px">
    
    <form id="myform" action="" method="post" >
    
    <table>
    <tr>
    <td>用户名称:</td>
    <td><input class="easyui-textbox" data-options=
    "required:true,validType:'length[2,5]',invalidMessage:'名称错误'" width="30"></td>
    
    </tr>
    
    <tr>
    <td>密码:</td>
    <td><input class="easyui-textbox" data-options=
    "required:true,validType:'length[6,6]',type:'password',invalidMessage:'密码长度为6'" width="30"></td>
    </tr>
    
    <tr>
    <td>年龄:</td>
    <td><input class="easyui-numberbox" data-options=
    "required:true,precision:0,min:18,max:60" width="30"></td>
    </tr>
    
    <tr>
    <td>生日:</td>
    <td><input class="easyui-datebox" data-options="required:true,editable:false" width="30"></td>
    </tr>
    
    <tr>
    <td>城市:</td>
    <td><select class="easyui-combobox"  style="100px">
        <option value="0">未选择</option>   
        <option value="1">北京</option>
        <option value="2">天津</option>
    </select></td>
    </tr>
    
    <tr>
    <td>城市1:</td>
    <td><input id="yij" class="easyui-combobox"  style="100px" data-options="valueField:'id',
    textField:'name',url:'JsonMembers?parentid=0',editable:false,value:'-1',
    onSelect: function(rec){
    var url='JsonMembers?parentid=' + rec.id;
    $('#erj').combobox('clear');
    $('#erj').combobox('reload',url);
    $('#erj').combobox('setValue','-1');
    
    $('#sanj').combobox('clear');
    $('#sanj').combobox('reload',url);
    $('#sanj').combobox('setValue','-1');
    }">
    </td>
    </tr>
    
    <tr>
    <td>城市2:</td>
    <td><input id="erj" class="easyui-combobox"  style="100px" data-options="valueField:'id',editable:false,
    textField:'name',url:'JsonMembers',value:'-1',
    onSelect: function(rec){
    var url='JsonMembers?parentid=' + rec.id;
    $('#sanj').combobox('clear');
    $('#sanj').combobox('reload',url)
    $('#sanj').combobox('setValue','-1')
    }">
    </td>
    </tr>
    
    <tr>
    <td>城市3:</td>
    <td><input id="sanj" class="easyui-combobox"  style="100px" data-options="valueField:'id',editable:false,
    textField:'name',url:'JsonMembers',value:'-1'">
    </td>
    </tr>
    
    <tr>
    <td>工资:</td>
    <td><input class="easyui-numberbox" data-options=
    "required:true,precision:2,min:0,max:6000,prefix:'$'" width="30"></td>
    </tr>
    
    <tr>
    <td>用户邮箱:</td>
    <td><input class="easyui-textbox" data-options=
    "required:true,validType:'email',missingMessage:'这是必填项'" width="30"></td>
    </tr>
    <tr>
    <td>个人主页:</td>
    <td><input class="easyui-textbox" data-options=
    "required:false,validType:'url',iconCls:'icon-search',prompt:'提示信息'" width="30"></td>
    </tr>
    
    
    <tr>
    <td>注册时间:</td>
    <td><input class="easyui-datetimebox" data-options="required:true,editable:false" width="30"></td>
    </tr>
    
    
    <tr>
    <td colspan=2 align="center">
    <a id="subbutton" class="easyui-linkbutton" style="80px;">提交</a>
    </td>
    </tr>
    </table>
    
    </form>
    </div>
    
    
    
    
    
    </body>
    </html>

  • 相关阅读:
    将01字符串转换成数字的办法
    Codeforces Round #180 (Div. 2) AB
    CPU制作过程『转』
    向VECTOR的头部添加元素
    母版页中js操作问题
    操作粘贴板
    XML和关系数据使用XML和数据集类
    XML和关系数据用XML加载数据集
    XPath和XSL转换向XML应用XSL转换
    XML和关系数据从XSD架构创建数据集映射
  • 原文地址:https://www.cnblogs.com/zxw0004/p/5081114.html
Copyright © 2020-2023  润新知