ExtJs之VTYPE验证

时间:2023-04-28 22:12:14
<!DOCTYPE html>
<html>
<head>
    <title>ExtJs</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
        <script type="text/javascript" src="ExtJs/ext-all.js"></script>
        <script type="text/javascript" src="ExtJs/bootstrap.js"></script>
        <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>

    <script type="text/javascript">
            Ext.onReady(function() {
                Ext.QuickTips.init();
                Ext.create('Ext.form.Panel', {
                    title: 'vtype.Sample',
                    width: 300,
                    frame: true,
                    renderTo: 'form',
                    bodyPadding: 5,
                    defaultType: 'textfield',
                    fieldDefaults: {
                        labelSeparator: ':',
                        labelWidth: 80,
                        width: 270,
                        msgTarget: 'side'
                    },
                    items: [{
                        fieldLabel: 'email',
                        vtype: 'email'
                    },{
                        fieldLabel: 'url',
                        vtype: 'url'
                    },{
                        fieldLabel: 'word',
                        vtype: 'alpha'
                    },{
                        fieldLabel: 'wordnumber',
                        vtype: 'alphanum'
                    }]
                });
            });
    </script>
</head>
<body>
    <div id='form'></div>
        <div id='form1'></div>

</body>
</html>

ExtJs之VTYPE验证