Skip to main content

Search and Top Navigation

#7883 closed bug (worksforme)

Opened November 15, 2011 01:49AM UTC

Closed November 15, 2011 02:43AM UTC

Last modified November 15, 2011 11:07PM UTC

" 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.

Attachments (0)
Change History (9)

Changed November 15, 2011 02:43AM UTC by scottgonzalez comment:1

resolution: → worksforme
status: newclosed

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

Changed November 15, 2011 10:02PM UTC by Den comment:2

Replying to [comment:1 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?

Changed November 15, 2011 10:04PM UTC by Den comment:3

<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's a sad day when "silly monsters" 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'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>

Changed November 15, 2011 10:14PM UTC by Den comment:4

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

Changed November 15, 2011 10:17PM UTC by k_borchers comment:5

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/

Changed November 15, 2011 10:29PM UTC by Den comment:6

Replying to [comment:5 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.

Changed November 15, 2011 10:37PM UTC by Den comment:7

Replying to [comment:6 Den]:

Replying to [comment:5 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?

Changed November 15, 2011 10:44PM UTC by scottgonzalez comment:8

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.

Changed November 15, 2011 11:07PM UTC by Den comment:9

Replying to [comment:8 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.