I want to fill a combobox with ajax when an other combobox change the value.
So I make a Ajax script and a xml file.
When this files is a php the ajax script does not work but when the same code in xml (and in the same line all the code) it works!
As I understant at 1st theere is not possible to read the xml file.
The code is that
Code:
<?php

 //Creates XML string and XML document using the DOM 
 $dom = new DomDocument('1.0'); 

 //add root - <selectChoice> 
 $selectChoice = $dom->appendChild($dom->createElement('selectChoice')); 
 //add <electElement> element to <selectChoice>
 $selectElement = $selectChoice->appendChild($dom->createElement('selectElement'));
 //add <formName> element to <selectChoice> 
 $formName = $selectElement->appendChild($dom->createElement('formName'));

 //add <formElem> text node element to <title> 
 $formName->appendChild( 
                 $dom->createTextNode('Form1')); 
 //add <formElem> element to <selectChoice> 
 $formElem = $selectElement->appendChild($dom->createElement('formElem'));

 //add <formElem> text node element to <title> 
 $formElem->appendChild( 
                 $dom->createTextNode('mdl'));
  //add root - <entry> 
 $entry = $selectChoice->appendChild($dom->createElement('entry'));
 //add <optionText> element to <entry>
 $optionText = $entry->appendChild($dom->createElement('optionText'));
   $optionText->appendChild(
                 $dom->createTextNode('Hello!'));
 //add <optionValue> element to <entry>
 $optionValue = $entry->appendChild($dom->createElement('optionValue'));
   $optionValue->appendChild(
                 $dom->createTextNode('1'));
                 //add <optionText> element to <entry>
 //add root - <entry> 
 $entry = $selectChoice->appendChild($dom->createElement('entry'));
 //add <optionText> element to <entry>
 $optionText = $entry->appendChild($dom->createElement('optionText'));
   $optionText->appendChild(
                 $dom->createTextNode('Hello!'));
 //add <optionValue> element to <entry>
 $optionValue = $entry->appendChild($dom->createElement('optionValue'));
   $optionValue->appendChild(
                 $dom->createTextNode('1'));

 //generate xml 
 $dom->formatOutput = true; // set the formatOutput attribute of 
                            // domDocument to true 
 // save XML as string or file 
 $test1 = $dom->saveXML(); // put string in test1 
echo $test1   ;
 ?>
Code:
<?xml version="1.0" ?> 
- <selectChoice>
- <selectElement>
  <formName>Form1</formName> 
  <formElem>mdl</formElem> 
  </selectElement>
- <entry>
  <optionText>Hello!</optionText> 
  <optionValue>1</optionValue> 
  </entry>
- <entry>
  <optionText>Hello!</optionText> 
  <optionValue>1</optionValue> 
  </entry>
  </selectChoice>
I want the xml to be dynamicall.
What is wrong?