Ticket #11633 (closed bug: invalid)
IE 8 throws internal error on presenting disabled textarea in fancybox
| Reported by: | per.newgro@… | Owned by: | per.newgro@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | misc | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
at first - sorry for not providing a testcase appropriatly. I really tried hard to add my issue to jsfiddle. But this is really user-un-friendly (complicated). But anyway.
On link click I want to show a (fancybox) window with a textarea. Because the current (business) mode is read-only the textarea is disabled. If i click the link in IE 8 i get the following error window:
There was an error while executing script Line: 3175 Character: 6 Error: Unknown Runtime error Code: 0 URL: file://...../jquery-1.7.1.min.js
My source code looks like this:
<!DOCTYPE html> <html>
<head>
<meta charset='utf-8'/> <title>POC - On demand textarea</title> <script src="ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script type='text/javascript' src='fancybox/source/jquery.fancybox.pack.js?v=2.0.5' language='JavaScript'></script> <link media='screen' rel='stylesheet' href='fancybox/source/jquery.fancybox.css?v=2.0.5' type='text/css'>
</head> <body>
<div>
<a id='activator' title='Click' href='#editor'>Click me</a>
</div> <form id='editorForm' action=>
<div id='editor'>
<textarea id='theText' rows='10' cols='10' disabled=>sadasdg</textarea>
</div> <input name='theValue' type='HIDDEN' value='sadasdg'> <script type='text/javascript' language='JavaScript'>
<!-- $(document).ready (function () {
$("#editor").hide(); $("#activator").fancybox({
autoSize : false, height : 300, width : 400, type : 'inline', title : "Ihre Bemerkungen", beforeLoad : function () {
var dbText = $("form.#editorForm > input[name='theValue']").val(); $("#theText").val(dbText); $("#editor").show();
}, afterShow : function () {
$("#theText").focus();
}, afterClose : function () {
var editorText = $("#theText").val(); $("form.#editorForm > input[name='theValue']").val(editorText);
}
});
}); -->
</script>
</form>
</body>
</html>
I know this is realy ugly but here is the fancybox urls http://fancyapps.com/fancybox/
Change History
comment:3 Changed 13 months ago by rwaldron
- Owner set to per.newgro@…
- Status changed from new to pending
comment:4 Changed 13 months ago by per.newgro@…
- Status changed from pending to new
Thanks for helping me out here. You're absolutely right. Setting the focus without a check if it's enabled is raising the error. In my script i've replaced this:
afterShow : function () {
$("#theText").focus();
},
by that:
afterShow : function () {
if (typeof $("#theText").attr("disabled") == "undefined") {
$("#theText").focus();
}
},
Sorry, but my IE8 (IETester) didn't showed me this detailed message. Otherwise i wouldn't have wasted your time. Sorry.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Sorry for blaming jsfiddle. Now it is clear how to use it. Here is the url http://jsfiddle.net/Cpqhy/5/