ext4 VTypes擴充套件

2021-08-31 15:32:41 字數 2455 閱讀 7310

新建乙個檔案,在檔案內插入如下內容:

return true;

},passwdtext: '兩次輸入的密碼不一致!',

chinese:function(val,field)

return true;

},chinesetext:'請輸入中文',

age:function(val,field)

catch(err)

},agetext:'年齡輸入有誤',

alphanum:function(val,field)

catch(e)

},alphanumtext:'請輸入英文本母或是數字,其它字元是不允許的.',

url:function(val,field)

catch(e)

},urltext:'請輸入有效的url位址.',

max:function(val,field)

catch(e)

},maxtext:'超過最大值',

min:function(val,field)

catch(e)

},mintext:'小於最小值',

datecn:function(val,field)

)-(\d)-(\d)$/;

if(!regex.test(val)) return false;

var d = new date(val.replace(regex, '$1/$2/$3'));

return (parseint(regexp.$2, 10) == (1+d.getmonth())) && (parseint(regexp.$3, 10) == d.getdate())&&(parseint(regexp.$1, 10) == d.getfullyear());

}catch(e)

},datecntext:'請使用這樣的日期格式: yyyy-mm-dd. 例如:2008-06-20.',

integer:function(val,field)

catch(e)

},integertext:'請輸入正確的整數',

minlength:function(val,field)

catch(e)

},minlengthtext:'長度過小',

maxlength:function(val,field)

catch(e)

},maxlengthtext:'長度過大',

ip:function(val,field)

(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(val)))

return true;

return false;

}catch(e)

},iptext:'請輸入正確的ip位址',

phone:function(val,field)

)?(0[12][0-9])?[-])?\d$/.test(val))

return true;

return false;

}catch(e)

},phonetext:'請輸入正確的**號碼,如:0920-29392929',

mobilephone:function(val,field)

$)/.test(val))

return true;

return false;

}catch(e)

},mobilephonetext:'請輸入正確的手機號碼',

alpha:function(val,field)

catch(e)

},alphatext:'請輸入英文本母',

money:function(val,field)

$/.test(val))

return true;

return false;

}catch(e)

},moneytext:'請輸入正確的金額'

});

在頁面引入上面新建的檔案,在相應介面的元件中定義vtype,即可進行有限驗證。

引用示例**:

//構建乙個密碼form    

var pwd = new ext.form.panel(,

defaulttype: 'textfield',

items: [,]

});

其中,initialpassfield是自定義的屬性,記錄上乙個password的id,然後在vtype的驗證函式中取出上乙個password元件的值,進行比較。

記住:上乙個password必須設定id屬性。

vtypes擴充套件

return true passwdtext 兩次輸入的密碼不一致!chinese function val,field return true chinesetext 請輸入中文 age function val,field catch err agetext 年齡輸入有誤 alphanum fu...

顯示 Ext2 Ext3 Ext4 結構資訊

要顯示乙個 ext2 ext3 ext4 資訊,可以使用 e2fsprogs 中的dumpe2fs或tune2fs l命令,例如 dumpe2fs dev sda1 或者tune2fs l dev sda1 dumpe2fs 會顯示 superblock 上的資訊和每個區塊組 block group...

ext2 ext3與ext4的區別

ext2與ext3 linux ext2 ext3檔案系統使用索引節點來記錄檔案資訊,作用像windows的檔案分配表。索引節點是乙個結構,它包含了乙個檔案的長度 建立及修改時間 許可權 所屬關係 磁碟中的位置等資訊。乙個檔案系統維護了乙個索引節點的陣列,每個檔案或目錄都與索引節點陣列中的唯一乙個元...