Link to home
Start Free TrialLog in
Avatar of SuW
SuW

asked on

PHP and XML combobox autofilling

Hello, i have 2 comboboxes on a page that i am filling through XML, the first one is working fine, but i can't get the second one to be populated correctly, it should be populated depending on the selection of the first combobox! is there any other way than AJAX to get this done ? ..
if not, how could i get that done using AJAX ?
below is the code i'm using.. the javascript does alert the correct value, but i can not get it into php inorder to request the data from my XML upon that value!
also, i do not want to get the page reloaded inorder to get the value throuhg GET or POST!

Thank you.. below is the code i'm using..
<form action="load.php" method="post">Select Cat<select name="categories" id="categories">
	<?php 
	$fff = '<script type="text/javascript">';
	$fff .= 'function getMainCat() {';
	$fff .= "var x = document.getElementById('categories').value;";
	$fff .= 'alert(x); }';
	$fff .= '</script>';
	?>
  </select><br /><br />Select Sub Category<select name="sub_categories" id="sub_categories" onchange="getMainCat();">

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CSecurity
CSecurity
Flag of Iran, Islamic Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SuW
SuW

ASKER

Thank you.