Side navigation
#11633 closed bug (invalid)
Opened April 24, 2012 01:18PM UTC
Closed April 25, 2012 07:16AM UTC
IE 8 throws internal error on presenting disabled textarea in fancybox
Reported by: | per.newgro@gmx.ch | Owned by: | per.newgro@gmx.ch |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | misc | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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:
-------------------8<-------------------8<-------------------8<
<!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>
-------------------8<-------------------8<-------------------8<
I know this is realy ugly but here is the fancybox urls
Attachments (0)
Change History (5)
Changed April 24, 2012 01:24PM UTC by comment:1
Changed April 24, 2012 01:25PM UTC by comment:2
Please check it with ie8. Ie9 and ff is working
Changed April 24, 2012 03:28PM UTC by comment:3
owner: | → per.newgro@gmx.ch |
---|---|
status: | new → pending |
Thank you for providing a fiddle, but we'll need a reduced test case that illustrates the issue using only the buggy code.
I did run your case in IE8 and this is what I saw:
[[Image(http://gyazo.com/06fe15614f23f1b7384df51ae36320c9.png)]]
Can you confirm that this is the issue you're encountering?
Changed April 25, 2012 06:46AM UTC by comment:4
status: | pending → 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.
Changed April 25, 2012 07:16AM UTC by comment:5
component: | unfiled → misc |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
Sorry for blaming jsfiddle. Now it is clear how to use it.
Here is the url http://jsfiddle.net/Cpqhy/5/