0
am I missing something? did he state that this was a web page?
0
Call this javascript function on onkeypress of textbox.
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57)){
alert("Please enter digits");
return false;
}
else{
return true;
}
}
0
Hi
using Onkeypress event ,u can solve ur problem.
write the code in java script
1.First find the keyboard event code.
var key=e.keycode;
2.convert to this code to char and compare this char with ur string(if u give integers in this string ,u allow integer only.otherwise if u give a to z,u allow only char)
3.if condition satisfy, return true,otherwise return false.
4.above funtion called in textbox onkeypress event.