Topic: dynamic select doesn't works on IE 8

Hi,

I have a problem. This script works on firefox, chrome but not on IE 8.
The xajax debug output is done.
The html option tag does'nt print in select tag liste_souscat ID .
Can you help me please ?

<?php
session_start();
include 'conf.php';
require_once("xajax/xajax_core/xajax.inc.php");

$xajax = new xajax();
$xajax->setFlag('debug',true);
$xajax->register(XAJAX_FUNCTION,'SelectSouscat');

function SelectSouscat($catid)
{
   $options="";
   $objResponse = new xajaxResponse();
   $sql="SELECT * FROM option_bet WHERE sport_id = '".$catid."' ";
   $req=mysql_query($sql);
   while ($souscat = mysql_fetch_array($req))
   {
      $options .= '<option value="'.$souscat['id'].'">'.$souscat['name_opt'].'</option>';
   }
   $objResponse->assign("liste_souscat","innerHTML",$options);
   return $objResponse;
}
$xajax->processRequest();
?>
<!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" dir="ltr" lang="en">

    <head profile="http://gmpg.org/xfn/11">
<? $xajax->printJavascript('xajax/');?>
<title>Calcio </title>

<link rel="stylesheet" href="/css/style-White.css?1111111" type="text/css" media="screen" />
</head>
<body >
<form id="testForm1"><br />
Select a category :
<select id="liste_cat" onchange="xajax_SelectSouscat(this.value)"><br />
<option value=""></option><br />
<strong>
<?
$sql="SELECT * FROM sport ";
$req=mysql_query($sql,$db) or die(mysql_error());
while($cat = mysql_fetch_array($req))
{
echo '<option value="'.$cat['id'].'">' . $cat['name_of_sport'] . '</option>';
} ?>
</strong><br />
</select><br />
Select another category :
<select id="liste_souscat" name="liste_souscat">
</select><br />
</form>
</body>
</html>

xajax debug output

Tue Aug 23 14:31:07 UTC+0200 2011
DONE [152ms]

Tue Aug 23 14:31:07 UTC+0200 2011
RECEIVED [status: 200, size: 600 bytes, time: 105ms]:<?xml version="1.0" encoding="utf-8" ?><xjx><cmd cmd="as" id="liste_souscat" prop="innerHTML"><![CDATA[S<option value="1">Vincitore</option><option value="2">Scommesse su promozione/ retrocessione</option><option value="3">Risultato primo tempo</option><option value="4">1X2</option><option value="5">Quanti gol totali?</option><option value="6">Risultato esatto</option><option value="7">Gol squadra</option><option value="8">Speciale Giocatori</option><option value="14">Doppia Chance</option><option value="15">Parziale / Finale</option><option value="16">Minuto dei gol</option>]]></cmd></xjx>

Tue Aug 23 14:31:06 UTC+0200 2011
SENT [52 bytes]

Tue Aug 23 14:31:06 UTC+0200 2011
SENDING REQUEST

Tue Aug 23 14:31:06 UTC+0200 2011
CALLING: xjxfun: SelectSouscatURI: http://www.mydomain.com/test1.php

Tue Aug 23 14:31:06 UTC+0200 2011
POST: xjxfun=SelectSouscat&xjxr=1314102666869&xjxargs[]=S1

Tue Aug 23 14:31:06 UTC+0200 2011
INITIALIZING REQUEST OBJECT

Tue Aug 23 14:31:06 UTC+0200 2011
PREPARING REQUEST

Tue Aug 23 14:31:06 UTC+0200 2011
PROCESSING PARAMETERS [1]

Tue Aug 23 14:31:06 UTC+0200 2011
INITIALIZING REQUEST

Tue Aug 23 14:31:06 UTC+0200 2011
STARTING XAJAX REQUEST

Re: dynamic select doesn't works on IE 8

Hi,

I have had a few problems using the innerHTML attribute on selects along the way. I finally just gave up and generated the entire select on the server and assigned it to the innerHtml of a div tag.

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: dynamic select doesn't works on IE 8

Thank you very much for your response, it works now!!!!!
It's the unique way ?