1

An odd request, I know. I want Javascript to pretend the user just pressed the backspace.

That's all I really want, if you want more info: My last topic here, gives more explaination. In short: I press a key, javascript converts the key to the greek equivalent, then puts that key in instead. The problem is, when onKeyUp is activated, it starts a function which looks for combinable character pairs put together (for accents) and inserts that key.

Community
  • 1
  • 1
DavidR
  • 5,350
  • 6
  • 30
  • 36

1 Answers1

0

Backspace example:

if (document.getElementById("text").value.length > 0)
{
    document.getElementById("text").value=document.getElementById("text").value.substring(0,document.getElementById("text").value.length-1);
}
Secko
  • 7,664
  • 5
  • 31
  • 37