Bug Tracker

Modify

Ticket #11633 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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:1 Changed 2 years ago by per.newgro@…

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

comment:2 Changed 2 years ago by per.newgro@…

Please check it with ie8. Ie9 and ff is working

comment:3 Changed 2 years ago by rwaldron

  • Owner set to per.newgro@…
  • Status changed from new to 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: http://gyazo.com/06fe15614f23f1b7384df51ae36320c9.png

Can you confirm that this is the issue you're encountering?

comment:4 Changed 2 years 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.

comment:5 Changed 2 years ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to misc

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.