View Full Version : Simple Job: fix dropdown script
lasvegas
05-25-2006, 10:01 PM
Hello,
Our dropdown script works fine in IE but not Firefox/Opera... need to know what to change... will paypal $ (let me know how much you will charge)
please take a look at classyauto (dot) com -> on the front page there is a make/model dropdown, when you select the make, the model selection only works in ie not firefox. let me know what needs to be fixed... thanks!
pm me with any questions.
jskaar
05-29-2006, 01:25 PM
Hi. I can see what that needs to be done... Have you coded it? If you would like, I can just paste you some code you need to change...
jskaar
05-29-2006, 01:50 PM
Doh, sorry if I'am spoiling any ones chance to get paid for this, but I couldn't help just fixing it... So sad if only IE customers should be able to use the drop down... ;)
This is what that needs to be replaced:
// Try XMLHTTPRequest
var req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.open("GET", "getModels.php?is_main=1&make="+value, false);
req.send();
if (req.status == 200) {
model.outerHTML = "<select name=model size=1 id=model><option value=0>Any</option>" + req.responseText + "</select>";
didit=1;
}
}
With this code:
// Try XMLHTTPRequest
var req;
// We try some different methods, to see which the users browser may support
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
try {req = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{
try{req = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e) {req = null;}
}
}
else
{
req = null;
}
if (req)
{
req.open("GET", "getModels.php?is_main=1&make="+value, false);
req.send(null);
if (req.status == 200)
{
model.outerHTML = "<select name=model size=1 id=model><option value=0>Any</option>" + req.responseText + "</select>";
didit=1;
}
}
Of course, I haven't tested this with your site, but I have a good feeling about this:) Just tell me if it isn't working as espected.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.