Codemirror / IE / Form compatibility issue

Having a bit of a weird issue and I am hoping that someone can point out if I’m making an error before I bug report or something.

In Chrome this works fine, in IE (version 9 or newer) it refuses to display the codemirror editor as long as its within form tags.

Evidence:
http://jsfiddle.net/ablueman/kmtorrkL (Ok in Chrome / Broken in IE)
form tags yes / form css yes.

http://jsfiddle.net/ablueman/kmtorrkL/32/ (Working in chrome and IE but not a form)
form tags no / form css yes.

http://jsfiddle.net/ablueman/kmtorrkL/33/ (working in chrome / Broken in IE.
form tags yes / form css no.

https://www.ablueman.co.uk/the/testbench/fourform.php
Evidence its not a quirks issue or otherwise something in jsfiddle.net

http://validator.w3.org/check?uri=https%3A%2F%2Fwww.ablueman.co.uk%2Fthe%2Ftestbench%2Ffourform.php
Damn thing validates as well.

If anyone has any ideas I’m all ears.

Hi,

I couldn’t see a fix but it seems to be more of a JS question. IE doesn’t seem to be running the js when the form is present. A couple of times it said ‘qta1’ not defined.

Your best bet is to post on github or in the discussion forum for codeMirror.

Sorry I couldn’t help.

1 Like

Actually that does help somewhat. I hadn’t specifically looked for whether the JS was running. At least that gives me an idea what the issue is. Just fricken strange that its happening within a form tag.

Sides, I’m grateful for any response at this stage :smile:

Just in case anyone finds this:

It is fixable by using:
var whatever = CodeMirror.fromTextArea(document.getElementById('theID'), { lineNumbers:true });

But that means the manual is essentially incorrect and the selector is presumably wrong

Logged a bug report:

1 Like

Thanks for the follow up and yes that’s where I was getting the error in IE so I thought the id wasn’t getting through to the routine.

Glad you got it working :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.