topical media & game development

talk show tell print

professional-javascript-11-NumericScrollExample2.htm / htm

          <title>Numeric Scroll Example</title>
          <script type="text/javascript" src="detect.js"></script>
          <script type="text/javascript" src="eventutil.js"></script>
          <script type="text/javascript" src="textutil.js"></script>
          <p>Type a number into the textbox, then press the up or down arrow. The value won't
          decrement below 0 and won't increment above 100.</p>
          <form method="post" action="javascript:alert('Submitted')">
                  <input type="text" onkeypress="return TextUtil.allowChars(this, event)" 
                      validchars="0123456789" onblur=" TextUtil.blurAllow(this)" 
                      onkeydown=" TextUtil.numericScroll(this, event)" 
                      max="100" min="0" />
              <input type="submit" value="Submit Form" />

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.