...

View Full Version : Check if there is no alphabets or symbols in a textbox



Rudurk
07-27-2006, 09:47 PM
is there a way to create some sort of a array that contains all the symbols or alphabets

e.g
a = 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,`,,!,",,$,%,^,&,*,(,),_,-,+,=,[,],{,},;,:,',@,#,~,,,.,<,>,/,?,|,\

if textbox==a then show some kind of alert message

can this be done ?

lansing
07-27-2006, 10:03 PM
Many different scripts for this on this page.

http://javascript.internet.com/forms/

ealbrecht
07-27-2006, 10:05 PM
What about restricting the types of characters that can be inputted. ie... if you tried to type an invalid character it just wouldn't let you. I haven't done this before, but it's just a theory, shouldn't be too hard to find some examples on Google.

Philip M
07-28-2006, 08:46 AM
if (/\D/.test(textbox.value)) { /// match any non-digit
alert ("You have entered a character which is not a digit");
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum