Internet Explorer 8 and 7 fails with error when i update the select box with new option and choose the selected option. In other browsers this works fine and without errors. I use Mootools 1.2.3.
<?php
$getdestiny=$_GET['dest'];
$getcountry=$_GET['countr'];
print "<script type='text/javascript'>
window.addEvent('domready', function() {
var countrh=$getcountry;
var desth=$getdestiny;
if (countrh==4){
$('destination').options.length=0; //error fails here
var opt0 = $('destination').options[0] = new Option('Сhoose Destination',0);
var opt1 = $('destination').options[1] = new Option('London-Aberdeen','1');
var len = $('destination').options.length;
if (desth < len){
opt$getdestiny.setProperty('selected','selected'); //or here
else {
//do nothing
}
});
</script>"
Can it be because i use double-assignment for vars opt* or what can it be else? Advise me please.