jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Button, RepeatButton, ToggleButton, LinkButton › Toggle button language render error
Tagged: toggle button
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 5 months ago.
-
Author
-
The following doesn’t work:
….
var IncrementLbl = ‘Incrément’; // é ==> is in browser source ‘& # 2 3 3 ;’ without spaces
…
$(‘#BtnRelative’).jqxToggleButton({ width: 40, height: 40, toggled: true, theme: theme});
…
function buttonclick() {
$(‘#BtnRelative’)[0].value = IncrementLbl;
}
….
<td id=’UC_REL’><input type=’button’ value=’Incrément’ id=’BtnRelative’/></td>
….Initialy the page shows the correct label text (HTML is renderend ok)
after a button click I update the value of the button.
The problem is that the complete (UTF-8 format)label text is set including the ‘ & # 2 3 3 ;’ (without spaces) part instead of rendering it to a special char.How can this be solved?
Hi marchutten,
According to us, that is related to your web page’s Encoding so I suggest you to check it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello,
I updated the example togglebutton.htm tpo what I mean, to show the problem:
————–test HTML code ————-
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta name=”keywords” content=”jQuery Toggle Button, Toggle Button, Button” />
<meta name=”description” content=”The jqxToggleButton represents a button widget that switches its checked state after a click.” />
<title id=’Description’>The jqxToggleButton represents a button widget that switches its checked state after a click.</title>
<link rel=”stylesheet” href=”../../jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”../../scripts/gettheme.js”></script>
<script type=”text/javascript” src=”../../scripts/jquery-1.10.2.min.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxbuttons.js”></script>
</head>
<body class=’default’>
<div id=’content’>
<script type=”text/javascript”>
$(document).ready(function () {
var theme = “”;// Create a jqxToggleButton widget.
$(“#jqxButton”).jqxToggleButton({ width: ‘200’, toggled: true, theme: theme });
$(“#jqxDisabledButton”).jqxToggleButton({ width: ‘200’, disabled: true, theme: theme });$(“#jqxButton”).on(‘click’, function () {
var toggled = $(“#jqxButton”).jqxToggleButton(‘toggled’);
if (toggled) {
$(“#jqxButton”)[0].value = ‘Incrément’;
}
else $(“#jqxButton”)[0].value = ‘Décrément’;
});
});
</script>
<div style=’width:200px;’ id=’jqxWidget’>
<div>
<input style=’margin-left: 25px;’ type=”button” value=”Incrément” id=’jqxButton’ />
</div>
<div>
<input style=’margin-left: 25px; margin-top: 10px;’ type=”button” value=”Disabled” id=’jqxDisabledButton’ />
</div>
</div>
</div>
</body>
</html>This code also generates the unwanted result. What am I doing wrong?
Note that the Incrment.Decrement values in the actual code are with utf-8 encoding (not what you see in the browser here)Hi marchutten,
Please, look at: http://stackoverflow.com/questions/9233464/special-html-characters-injected-with-js. It shows how to display special characters in HTML Button which is actually what our Button is.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.