i am design a web form in asp.net with c# ,in this form some textboxes is there ,in first text box it must accept numbers but not characters , Blank spaces and special characters how to validte in client side through javascript and also cursur position should be in first textbox..
help
Collapse
X
-
Hai Baby This Is only Possible in java script.........
Note:- Text Box Id======== t1
<script>
function number()
{
var num=document .getElimentById ("t1").value ;
if(num==" ")
{
alert(" Please Enter Number ");
num.focus(true) ;
num.select(true );
}
else if(isNaN(num))
{
alert("Please enter proper number ");
num.focus(true) ;
num.select(true );
}
}
Note:-- Button Propeties ===== Onclientclick ===put ==Function name
exaple:-- Onclientclick=n umber()Comment
Comment