Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTF-8 porblem with IE 6.0 using function new Option()

Status
Not open for further replies.

dioxyde

Programmer
Oct 29, 2005
4
ES
I have the next HTML page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<SCRIPT language=JavaScript; charset=UTF-8">
function populate() {
var option = new Option("Almer&iacute;a","01");
..
}
</SCRIPT>
..

But when i populate my select field I see Almer&iacute;a not Almería,
and putting Almería I have html Errors in IE 6.0

Thanks
 
I see...
but...check this code, there is an IE 6.0 Error using the actual caracter (Almería) but not with (Almeria)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<SCRIPT language=JavaScript>
<!--
function populate() {
var option0 = new Option("Cualquiera","00");
var option1 = new Option("Almería","01");

for (var i=0; i <=1; i++) {
eval("document.myform.myselect.options=option" + i)
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload='javascript:populate();'>

<FORM name=myform action="myAction" method=post>
<SELECT name=myselect>
<OPTION value=0 selected>(No importa)</OPTION>
</SELECT>
</form>
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top