Opened 11 years ago
Closed 11 years ago
#11633 closed bug (invalid)
IE 8 throws internal error on presenting disabled textarea in fancybox
Reported by: | Owned by: | ||
---|---|---|---|
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:
<!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 (5)
comment:1 Changed 11 years ago by
comment:3 Changed 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:4 Changed 11 years ago by
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.
comment:5 Changed 11 years ago by
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/