|
|
|
ขอ script php ที่เช็คว่าตัวแปรนี้มีแต่ภาษาอังกฤษอย่างเดียวหรือไทยอย่างเดียวหน่อยครับ |
|
|
|
|
|
|
|
<script language="javascript">
function AllowOnly(Expression,msg)
{
Expression = Expression.toLowerCase();
Expression = Replace(Expression, 'a..z', 'abcdefghijklmnopqrstuvwxyz');
Expression = Replace(Expression, '¡..Î', '¡¢£¤¥¦§¨©ª«¬­®°º»¾Ã¹ÂÅÀ¶¼·Á½Æ¿Ä¯´');
Expression = Replace(Expression, '0..9', '0123456789');
Expression = Replace(Expression, '|', '');
var ch = String.fromCharCode(window.event.keyCode);
ch = ch.toLowerCase();
Expression = Expression.toLowerCase();
var a = Expression.indexOf(ch);
if (a == -1){
window.event.keyCode = 0;
alert(msg);
}
}
}
</script>
<INPUT name=u_name class="f12" id=user2 size="25" maxLength=16 onKeyPress="AllowOnly('1,2,3,4,5,6,7,8,9,0,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z','Insert \nExample a..z or A..Z or 123...9')">
|
|
|
|
|
Date :
23 ม.ค. 2550 20:58:35 |
By :
arsachi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|