<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Javascript that will allow text box entry by selected key board keys  ... Validation</Title>
      <Shortcut>Javascriptthatwillallowtextboxentrybyselectedkeyboardkeys...Validation</Shortcut>
      <Description>Javascript that will allow text box entry by selected key board keys  ... Validation [HTML &amp; Javascript]</Description>
      <Author>Greg Gamble</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=eaa388ec-6f85-4858-9042-d2d01ca03c84</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="HTML &amp; Javascript"><![CDATA[<html>
<head>
<script language='JavaScript'>
function checkKey(e) {
        var key = e.which || e.keyCode; // NS vs. IE
        // allow digits, decimal, tab, backspace, return
        if (
                        (       key != 8
                        && key != 9
                        && key != 13
                        && key != 46
                        )
                        && (key < 48 || key > 57)
        ) { return false; }
}
</script>
</head>
<body>
	<h3>type a number (decimals OK)</h3>
	<form>
		<input type='text' size='3' maxlength='4' name='num' onKeyPress='return checkKey(event);' />
	</form>
</body>
</html>]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>