0

Before you ask why im using IE5, Its because im making a application for a device that runs on Windows CE, and the Internet Explorer function thats running on the device is IE5.....

Now on to my question, I've made a piece of code for "handling" data. And with handling i mean using specific functions to make a end string that i submit. I have 1 textbox called bonregels and the data from that textbox should go into the textarea after a short period of time. I tought i had it working but all of the sudden it did not work anymore, the data from the textfield did not go into the textarea. Can someone help me figure out whats goeing wrong?

This is my fiddle with the code that ive made: https://jsfiddle.net/bm6Lprdd/

Heres the javascript function that handels the data transfer from the textbox to the textarea.

function AddToList () {
    var bonregel = document.getElementById("bonregel");
    var val = bonregel.value.toString();

    if (val != "") {
        var box = document.getElementById("bonregelbox");
        if (box.value != "")
            box.value = val + "\n" + box.value;
        else
            box.value = val + box.value;
    }

    bonregel.value = "";
    bonregel.focus();
}

var delayred = [];

function delay(callback, id, calldelay) {
    clearTimeout(delayrec[id]);
    delayrec[id] = setTimeout(callback, calldelay);
}

function keyup(event) {
    var locatiebox = document.getElementById("locatie");
    var bonregelbox = document.getElementById("bonregelbox");
    var bonregels = bonregelbox.value.split(/\r\n/).join(",");
    var locatie = locatiebox.value;

    if (event.keyCode == 125)
        SubmitContent(locatie, bonregels);
    else
        delay(AddToList, "AddToList", 500);
}

I think this piece of code is the problem but im not sure, the other code can be found in the fiddle.

Collin
  • 914
  • 1
  • 9
  • 30
  • ahaha its not that bad, right?... – Collin Jun 16 '15 at 08:15
  • 4
    ie5? our hearts and thoughts go out to you my friend. good luck with that – Emre Türkiş Jun 16 '15 at 08:16
  • Does the problem only occur in IE5, or could you reproduce it in a modern browser? – Bergi Jun 16 '15 at 08:25
  • The time i've put in to this thing... for a simple application you have some much restrictions. – Collin Jun 16 '15 at 08:26
  • @Bergi, look in the fiddle, it also isnt working there – Collin Jun 16 '15 at 08:26
  • Can I ask, why are you targeting Windows CE, a nearly 20-year-old OS? – Sampson Jun 16 '15 at 17:27
  • Yes you can @JonathanSampson, but why wouldnt i target it. Maybe there is a device running on windows CE that needs a new application and maybe im doeing with html and load in the webpage trough IE – Collin Jun 17 '15 at 06:13
  • @CKY I'm just curious; I imagine the inherent cost of maintaining a 20-year old (unsupported?) operating system would greatly out-weight the cost of updating or going open-source. – Sampson Jun 17 '15 at 06:29
  • What makes you think that Windows CE is unsupported... Microsoft realeased a version back in 2013.... so the version that im working with is also still supported. – Collin Jun 17 '15 at 06:31
  • But i see what you mean @JonathanSampson, it could be cheaper to use a open source device – Collin Jun 17 '15 at 06:40
  • @CKY I was assuming (perhaps incorrectly) that if you are still limited to IE 5 then you were on an unsupported version. After all, newer versions of Internet Explorer were released for Windows CE. **Note: I work on the Internet Explorer and Microsoft Edge team.** – Sampson Jun 17 '15 at 06:42
  • Im not limited to IE5 but i wanted it to work, also on IE5 for the older devices we use. Those will be upgraded within the next year – Collin Jun 17 '15 at 06:45

1 Answers1

1
var delayred = [];

should be

var delayrec = {};
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
  • Thanks for the suggestion, but that still doesnt fix the issue. – Collin Jun 16 '15 at 08:24
  • The problem is within the keup(event) function, Can you help me with solving the problem – Collin Jun 16 '15 at 09:00
  • 1
    Maybe try [`window.event`](https://msdn.microsoft.com/en-us/library/ms535863(v=vs.85).aspx) instead of an argument. – Bergi Jun 16 '15 at 14:58
  • The [fiddle works well](https://jsfiddle.net/bm6Lprdd/3/) for me with the fix applied and the [fiddle problem](http://stackoverflow.com/q/5431351/1048572) solved. – Bergi Jun 16 '15 at 15:08
  • Only I have no idea what triggers keycode 125, so I could not test that. – Bergi Jun 16 '15 at 15:08
  • keycode 125 is a button on the device where windows ce is running on – Collin Jun 17 '15 at 06:12
  • @CKY: Ah good to know. So what's the error you're getting, or does it work now? – Bergi Jun 17 '15 at 07:09
  • No it doesnt still doesnt work, but i made a change of plans. I will handle the input of the textarea a different way because i couldnt get this to work – Collin Jun 17 '15 at 07:11
  • Still dont know why this doesnt work but i dont want to waste 3 or 4 days figurering it out – Collin Jun 17 '15 at 07:12
  • Well, the fiddle does work fine with that fix, so if you cannot give us a more detailed description of the problem, and maybe some debugging results, then we cannot help you. – Bergi Jun 17 '15 at 07:15
  • I understand @bergi, But i dont understand the problem myself. On the fiddle it works, in chrome and the latest version of IE its works, but when i try it on an older version of IE it doesnt work – Collin Jun 17 '15 at 07:17
  • Still I would expect even IE5 to have some kind of error reporting feature (like [IE6 had](http://sixrevisions.com/javascript/javascript-debugging-techniques-in-ie-6/)) – Bergi Jun 17 '15 at 07:37
  • Yeah but it doesnt trhow an error and back in the day you could not press f12 to look at the sources(i think) – Collin Jun 17 '15 at 07:52