identify if numbers only in a string

I

Igal

Hay.
in one part of my application i have some kind of user and password
form.
it asks for e-mail and a costumer id (as password), the costumer id
must be a number, it's an INT in the SQL table. i tried to use a
javascript checking method, but this kind of checking method seems not
to work at all in firefox, so i'll do the checking via asp.

what i need to know is how to check if a some VAR got anything except
numbers in it?
 
E

Evertjan.

Igal wrote on 20 nov 2006 in microsoft.public.inetserver.asp.general:
what i need to know is how to check if a some VAR got anything except
numbers in it?

<script language='javascript' runat='server'>
function notAllDigits(x){
return /\D/.test(x);
};
</script>

<%
response.write notAllDigits("12345X")
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,137
Messages
2,570,794
Members
47,342
Latest member
eixataze

Latest Threads

Top