I have a page with drop downs in a form that collect values by ajax/javascript from MySQL-database. The table and the page are utf8_swedish_ci. The values are sent correctly to the page as:
new Array("3|Advent","8|Fastan","1|Jul","7|Kyndelsm?ssodagen","9|P?sk","6|Treenigheten")
As you can see the letters ?, ? and ? is shown correctly. When showed on the page they become ?.
The javascript code on page is:
<script type="text/javascript" charset="utf8_swedish_ci">
function AjaxFunction(which, KregHuvud_ID, url)
{
var httpxml;
try
{
// Firefox, Opera 8.0+, Safari
httpxml=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
httpxml=new ActiveXObject("[login to view URL]");
}
catch (e)
{
try
{
httpxml=new ActiveXObject("[login to view URL]");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
function stateck()
{
if(httpxml.readyState==4)
{
var myarray=eval([login to view URL]);
var obj;
if(which == 1)
obj = [login to view URL];
else
obj = [login to view URL];
// Before adding new we must remove previously loaded elements
for(j=obj.options.length-1;j>=0;j--)
{
[login to view URL](j);
}
for (i=0;i<[login to view URL];i++)
{
var optn = [login to view URL]("OPTION");
var optiondata = myarray[i].split("|");
[login to view URL] = optiondata[1];
[login to view URL] = optiondata[0];
[login to view URL](optn);
}
}
}
url=url+"?KregHuvud_ID="+KregHuvud_ID;
url=url+"&sid="+[login to view URL]();
httpxml.onreadystatechange=stateck;
[login to view URL]("GET",url,true);
[login to view URL](null);
}
</script>
On [login to view URL] you can see the drop downs. The drop downs to the right is included by the javascript and shown wrong. The string can be seen at [login to view URL]
I need help to solve the charset problem in the drop down fields to the right.
I'm looking forward your bids!