T
Tharika
Hi,
I have a web page with a <select> listbox that contains both English
strings and Kanji-character strings in the options. The charset on the
page is set to UTF-8 and on load of the page, both language strings
are displayed correctly.
I have a javascript function where the user can select a list item and
click on a button to move it up in the sequence or down, basically to
let them set an order among the list items. The logic used is a simple
swap of two values, with the selected item value stored in a temp.
variable, the selected item replaced with the next item in the list
and the next item replaced with the temp. variable. Below is the code
for moving up the item,
function GoUp()
{
var i, j, s, seltext, selval, selcol
if (frmModCon.lstConSeq.length > 0)
{
j = frmModCon.lstConSeq.selectedIndex;
if (j != -1)
{
seltext = frmModCon.lstConSeq(j).innerText;
selval = frmModCon.lstConSeq(j).value;
selcol = frmModCon.lstConSeq(j).style.color;
s = parseInt(frmModCon.lstConSeq.length) - 1;
if (j!=0)
{
i = parseInt(j) - 1;
frmModCon.lstConSeq.item(j).selected = false;
frmModCon.lstConSeq(j).innerText =
frmModCon.lstConSeq(i).innerText;
frmModCon.lstConSeq(j).value = frmModCon.lstConSeq(i).value;
frmModCon.lstConSeq(j).style.color =
frmModCon.lstConSeq(i).style.color;
frmModCon.lstConSeq.item(i).selected = true;
frmModCon.lstConSeq(i).innerText = seltext;
frmModCon.lstConSeq(i).value = selval;
frmModCon.lstConSeq(i).style.color = selcol;
}
}
}
}
I notice that as long as one Kanji-character list item is swapped with
another Kanji-character list item, the display is still fine. However,
when an English string and a Kanji-character string are swapped, the
Kanji-character display is lost and starts showing boxes in place of
the characters.
What am I doing wrong? Any help will be appreciated as this issue is
holding up entire application deployment.
Thanks........... Tharika
I have a web page with a <select> listbox that contains both English
strings and Kanji-character strings in the options. The charset on the
page is set to UTF-8 and on load of the page, both language strings
are displayed correctly.
I have a javascript function where the user can select a list item and
click on a button to move it up in the sequence or down, basically to
let them set an order among the list items. The logic used is a simple
swap of two values, with the selected item value stored in a temp.
variable, the selected item replaced with the next item in the list
and the next item replaced with the temp. variable. Below is the code
for moving up the item,
function GoUp()
{
var i, j, s, seltext, selval, selcol
if (frmModCon.lstConSeq.length > 0)
{
j = frmModCon.lstConSeq.selectedIndex;
if (j != -1)
{
seltext = frmModCon.lstConSeq(j).innerText;
selval = frmModCon.lstConSeq(j).value;
selcol = frmModCon.lstConSeq(j).style.color;
s = parseInt(frmModCon.lstConSeq.length) - 1;
if (j!=0)
{
i = parseInt(j) - 1;
frmModCon.lstConSeq.item(j).selected = false;
frmModCon.lstConSeq(j).innerText =
frmModCon.lstConSeq(i).innerText;
frmModCon.lstConSeq(j).value = frmModCon.lstConSeq(i).value;
frmModCon.lstConSeq(j).style.color =
frmModCon.lstConSeq(i).style.color;
frmModCon.lstConSeq.item(i).selected = true;
frmModCon.lstConSeq(i).innerText = seltext;
frmModCon.lstConSeq(i).value = selval;
frmModCon.lstConSeq(i).style.color = selcol;
}
}
}
}
I notice that as long as one Kanji-character list item is swapped with
another Kanji-character list item, the display is still fine. However,
when an English string and a Kanji-character string are swapped, the
Kanji-character display is lost and starts showing boxes in place of
the characters.
What am I doing wrong? Any help will be appreciated as this issue is
holding up entire application deployment.
Thanks........... Tharika