I have a text box for number input. Validator works fine for range 1 to 100, but it still allows the return key to be used. I want to tell ASP.NET, using VB, to ignore a return key press. Any ideas?

you can do that using javascript.

<script language="javascript" type="text/javascript">
function stopRKey(evt) {
	var evt  = (evt) ? evt : ((event) ? event : null);
	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	if ((evt.keyCode == 13) && (node.type=="text")) { return false; }
}
document.onkeypress = stopRKey;
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.