Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7883 closed bug (worksforme)

" Blocks dialog box

Reported by: Den Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Description

When user entered data includes quotation marks, standard practice is to convert them to " or &x34;. Neither of these work inside the text of the dialog box.

Change History (9)

comment:1 Changed 11 years ago by Scott González

Resolution: worksforme
Status: newclosed

HTML entities work fine. Please provide a reduced test case showing the problem if you continue to have trouble.

comment:2 in reply to:  1 Changed 11 years ago by Den

Replying to scott.gonzalez:

HTML entities work fine. Please provide a reduced test case showing the problem if you continue to have trouble.

Yes, in general, HTML Entities work fine. Any form of a double quote does NOT work. Did you test it?

comment:3 Changed 11 years ago by Den

<script src="SampleStuff/jquery-1.6.2.min.js" type="text/javascript"></script> <script src="SampleStuff/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script> <link href="SampleStuff/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" /> <script type ="text/javascript">

function PopMessage(ttl, Message, Q) {

$("#dialog-message").dialog({

modal: false, title: ttl, resizable: false, position: [200, 200], buttons: {

Ok: function() {

$(this).dialog("close");

}

}

});

var x = "<img style='float:left; margin:0 7px 5px 0;' src='" + Q + "' />";

$("#dialog-message")[0].innerHTML = "<p>" + x + Message + "</span></p>"; $("#dialog-message").dialog('open');

}

</script>

<body> <img src="SampleStuff/Fnark.jpg" title="Click for FAIL" alt="Click for FAIL" onclick='PopMessage("Dennis", "It&#39;s a sad day when &quot;silly monsters&quot; spoil the fun, eh?", "SampleStuff/images/Fnark.jpg");' /> <br /> <img src="SampleStuff/Fnark.jpg" title="Click for More" alt="Click for More" onclick='PopMessage("Dennis", "It&#39;s a sad day when silly monsters spoil the fun, eh?", "SampleStuff/images/Fnark.jpg");' /> <div id="dialog-message"></div> <script language="javascript" type="text/javascript">

$(document).ready(function() {

$("#dialog-message").dialog({ autoOpen: false });

});

</script> </body>

comment:4 Changed 11 years ago by Den

I don't see any way to upload an example. I have a small zip file which replicates the issue very well.

comment:5 Changed 11 years ago by k_borchers

Works for me too. Here is a simplified version of your code and it works just fine so there is not an issue with Dialog. http://jsfiddle.net/kborchers/qBVrE/

comment:6 in reply to:  5 ; Changed 11 years ago by Den

Replying to k_borchers:

Works for me too. Here is a simplified version of your code and it works just fine so there is not an issue with Dialog. http://jsfiddle.net/kborchers/qBVrE/

One of the modifications you made was to the jquery version. Obviously, I need to upgrade. Thanks. For the record, it does NOT work in the version that I was using, 1.6.2.

comment:7 in reply to:  6 Changed 11 years ago by Den

Replying to Den:

Replying to k_borchers:

Works for me too. Here is a simplified version of your code and it works just fine so there is not an issue with Dialog. http://jsfiddle.net/kborchers/qBVrE/

One of the modifications you made was to the jquery version. Obviously, I need to upgrade. Thanks. For the record, it does NOT work in the version that I was using, 1.6.2.

Correction, still does not work.

http://jsfiddle.net/qBVrE/2/

This shows the way this is used. The event is the onclick of the image. The code is generated, so this is the way it comes out. Any thoughts?

comment:8 Changed 11 years ago by Scott González

You're only encoding the quotes inside the attribute, the string that gets passed to your function is no longer encoded. You should really just change your code to not use the onclick attribute. Please use the forums for help.

comment:9 in reply to:  8 Changed 11 years ago by Den

Replying to scott.gonzalez:

You're only encoding the quotes inside the attribute, the string that gets passed to your function is no longer encoded. You should really just change your code to not use the onclick attribute. Please use the forums for help.

So you are saying the browser unencodes it before passing it to the javascript method. bad form. really bad form. Ok. I will see if I can get this thing ripped apart and reworked to generate the javascript on the fly instread of just the image tags. nasty. Thanks.

Note: See TracTickets for help on using tickets.