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.
PaulOB
November 4, 2014, 4:46pm
2
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
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:
opened 09:06PM - 04 Nov 14 UTC
closed 09:45AM - 05 Nov 14 UTC
Codemirror replacing a textarea in form tags. Works fine in Chrome and Firefox. … However in IE it fails. Using: "var myCodeMirror4 = CodeMirror.fromTextArea(QTA4, {"
as per http://codemirror.net/doc/manual.html
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
I noticed that sometimes the JS failed to run with QTA1 undefined.
If I defined the variable prior it failed for other reasons.
It is fixable by using:
var myCodeMirror2 = CodeMirror.fromTextArea(document.getElementById('QTA2'), {
http://jsfiddle.net/ablueman/kmtorrkL/41/
But that means the manual is essentially incorrect.
Hope this helps.
Andy
1 Like
PaulOB
November 5, 2014, 11:18am
5
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
system
Closed
February 4, 2015, 6:24pm
6
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.