Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding keyCodes for End, Home, Delete ...  RSS feed

 
Ian MacKenzie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there!

I've got a problem and you probably might help me with it (at least I hope so, as well as I hope to post this in the right forum).

The following code snippet is from the page I'm working on:



As you might read from it, I've got an input field which only allows entering characters from 0 - 9. Working fine. Now the problem is, that with this kind of code, keys like End, Home, Delete and the Arrow Keys aren't working anymore too.
Is there any way to alter the shown code? Or maybe show me another one with the desired functions (only allowed keys/input are 0 - 9 as well as End, Home, Delete and the Arrow L/R keys)?

Cheers in Advance

Mac
 
Ian MacKenzie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the solution, found it out myself:



See you around.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to consider breaking that out into a javascript function definition instead of cramming it all inline like that, though. Long javascript in attributes is murder to read, murder to print, and murder to debug.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!