cedericvh (3) [Avatar] Offline
#1
I can load the contents of the second combo when I change the first combo.

However : Combo 2 always shows the same values not based upon the first combo... Does anyone have an idea ?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<meta http-equiv="Content-Language" content="en-us">

<meta name="keywords" content="test">
<title>Prototype test</title>
<? <br /> include "dataobjects/Wd_tblthema.php";
include "dbconfig.php";

$thema=new DataObjects_Wd_tblthema;
$number_of_rows = $thema->find();
?>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="doubleCombo.js"></script>
<script type="text/javascript" >
function injectComponentBehaviors() {
var doubleComboOptions = {};
new DoubleCombo( 'dllThemas',
'dllHowtos',
'howtos.php',
doubleComboOptions );
}
</script>


</head>
<body onload="injectComponentBehaviors()">
<form name="form" method="post">
<? <br /> echo "<select name="dllThemas" id="select1"><br /> ";
while ($thema->fetch()) {
printf("<option value="%s">%s
",
$thema->thema_id,
$thema->thema_omschrijving);
echo "</option>
";
}
echo "</select>
";
?>

<select name="dllHowtos" id="select2"></select>

</form>




</body>
</html>


Thist is the xml-output of howtos.php :

<?xml version="1.0" encoding="UTF-8" ?>
<selectChoice>
<entry>
<optionText>test</optionText>
<optionValue>2</optionValue>
</entry>
<entry>
<optionText>Div's in dreamweaver</optionText>
<optionValue>1</optionValue>
</entry>
<entry>
<optionText>Photoshop1</optionText>
<optionValue>2</optionValue>
</entry>
<entry>
<optionText>Photoshop 2</optionText>
<optionValue>2</optionValue>
</entry>
<entry>
<optionText>Photoshop 3</optionText>
<optionValue>2</optionValue>
</entry>
<entry>
<optionText>Photoshop 4</optionText>
<optionValue>2</optionValue>
</entry>
</selectChoice>

Where can I pass the variable ?
Pascarello (208) [Avatar] Offline
#2
Re: Double combo : combo 2 values based on combo one value
Not sure what you are saying. If you change the first selection value the first time the second selection list fills in fine. If you change the first selection list a second time the changes do not reflect in the second list?

What browser are we talking about here?

Eric
cedericvh (3) [Avatar] Offline
#3
Re: Double combo : combo 2 values based on combo one value
Hi,

Thanks for the quick answer !

I mean that independently of which value you choose in the first combo the second combo always gives the same results...

This is Internet Explorer 7 beta... Firefox gives the same result.

I wonder where I should solve this. I'm new to Ajax, the book is very inspiring....

Regards,

Cederic
Pascarello (208) [Avatar] Offline
#4
Re: Double combo : combo 2 values based on combo one value
Man, I barely looked at your XML, all of the values are 2 and one 1. Hence it will not change since it uses the value to get the new data.

Eric

Message was edited by:
Pascarello
cedericvh (3) [Avatar] Offline
#5
Re: Double combo : combo 2 values based on combo one value
OK...

I also tried to have the value 7... still the same result.

Where do I need to filter the XML values ?

Kind regards,

Cederic