Monday, June 2, 2008

javascript: Enter only integer Value

var LimitDisplay=document.getElementById(Temp + "txtLimitDisplay").value.trim();
var validChars = "0123456789";

for(i=0;i < LimitDisplay.length;i++)
{ if(validChars.indexOf(LimitDisplay.charAt(i)) == -1)
{ alert("Please enter only numeric value in Max Views");
document.getElementById(Temp + "txtLimitDisplay").focus();
return false;
}
}

No comments: