hi..
i have a text box..where user input their value.
but i want to allow only numeric values not alphabets and blankspaces..
how to do this in asp..
regards
meenu
<SCRIPT language="JavaScript">
function abc(t1)
{
var a,i,s
var count=0
var r=""
var chk=0
a=t1.value.length
for(i=0;i<a;i++)
{
s=t1.value.substring(i,i+1)
if(s>="0" && s<="9"){}
else
{
chk=1
alert("Please enter numerics values only.");
t1.focus();
break;
}
}
}
function IEKeyCap()
{
if ((window.event.keyCode < 46) || (window.event.keyCode > 57) || (window.event.keyCode == 47) || (window.event.keyCode == 46) )
{
window.event.keyCode = 0
};
}
</SCRIPT>
and in textbox-----> onKeyPress='IEKeyCap()' onBlur='abc(this)'