event.keyCode, where can I get a map for these?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick Gibbons

    event.keyCode, where can I get a map for these?

    I would like to know what keycode # pertains to what keycode . . .

    This code allows a user to limit the entries in a form to only those
    keycodes they would like, #s only for US zip codes, for example. What I
    would like to know is what keycode #s pertain to what keycode. There should
    be a list out there somewhere, no?


    --

    Please contact me if you have any questions,

    Patrick Gibbons
    fnkleroi@hotmai l.com


  • Dr John Stockton

    #2
    Re: event.keyCode, where can I get a map for these?

    JRS: In article <evUUa.121960$I o.10414787@news read2.prod.itd. earthlink.
    net>, seen in news:comp.lang. javascript, Patrick Gibbons
    <fnkleroi@hotma il.com> posted at Sun, 27 Jul 2003 18:04:58 :-[color=blue]
    >I would like to know what keycode # pertains to what keycode . . .
    >
    >This code allows a user to limit the entries in a form to only those
    >keycodes they would like, #s only for US zip codes, for example.[/color]

    Most users, on being asked to enter a valid postal code, will enter a
    valid postal code; or at least one which is grammatically sound.

    I see little point in forcing them to download all the code which is
    necessary to scrutinise the individual keystrokes, when it is easier to
    validate the code on loss-of-focus or completion-of-data.

    Completed postal codes can be checked, quite economically, by using a
    well-chosen RegExp; a liberal check for world-wide codes, a rigorous
    format check for Canadian ones, a choice for UK ones, etc.

    Will
    OK = /^[a-zA-Z0-9- ]{m,n}$/.test(PoCo)
    or a little more, match all world postcodes, after whitespace
    normalisation ? What are the proper m & n ?

    [color=blue]
    >Please contact me if you have any questions,[/color]

    QHAH. FAQ 2.3, 2.4.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
    <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
    <URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
    <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c. FAQ items, acronyms

    Comment

    Working...