1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| <script type="text/javascript">
if (window.XMLHttpRequest) {
oXmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
oXmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
function selectManufacturer(id) {
var category, data;
document.getElementById('subcategory').innerHTML = "";
oXmlhttp.open('POST',"recherche-listesderoulantes-resultats.php");
oXmlhttp.onreadystatechange=function() {
if (oXmlhttp.readyState==4 && oXmlhttp.status == 200) {
leselect = oXmlhttp.responseText;
leselect = leselect.replace('<option value="13709">Accessoires</option>','<option value="13709">Accessoires auto</option>').replace('<option value="13801">Produits</option>','<option value="13801">Produits Peinture</option>').replace('[........]');
if ( (category = document.getElementById('category')) != null ) {
category.innerHTML = leselect;
Array.prototype.sort.call(category.options,function(a,b){
return a.text < b.text
? -1
: a.text > b.text
? 1
: 0;
});
}
}
}
oXmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
data = 'q=m&id='+id;
oXmlhttp.send (data);
}
function selectCategory(manufacturer,category) {
oXmlhttp.open('POST',"recherche-listesderoulantes-resultats.php");
oXmlhttp.onreadystatechange=function() {
if (oXmlhttp.readyState==4 && oXmlhttp.status == 200) {
leselect = oXmlhttp.responseText;
document.getElementById('subcategory').innerHTML = leselect;
}
}
oXmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var data = 'q=c&manufacturer='+manufacturer+'&id='+category;
oXmlhttp.send (data);
}
</script> |
Partager