<script type="text/javascript">
function fetchModel(manufacturer,type) {
var models = new Array();
var list = manufacturer.selectedIndex;
var selected = manufacturer.options[list].value;
models[0] = "<option value='0'>Select </option>";
<?php
foreach($CarModels as $key => $val) {
echo 'models['.$key.'] = "<option value=\'0\'>Select </option>";';
foreach($val as $model) {
echo 'models['.$key.'] = models['.$key.'] + "<option value=\''.$model["model_id"].'\'>'.$model["model_name"].'</option>"; ';
}
}
?>
//alert(models[selected]);
//alert(type);
if(type=="new") {
document.getElementById("new_model_id").innerHTML = models[selected];
}
else{
document.getElementById("model_id").innerHTML = models[selected];
}
}
</script>
Javascript to fetch data on database
Page 1 of 15 Replies - 468 Views - Last Post: 08 December 2012 - 01:22 PM
#1
Javascript to fetch data on database
Posted 08 December 2012 - 07:20 AM
Hi i have created a javascript to fetch data from database unfortunately it is not working on Internet Explorer browser but it works for Firefox, Chrom, Safari.
Replies To: Javascript to fetch data on database
#2
Re: Javascript to fetch data on database
Posted 08 December 2012 - 07:36 AM
Define "not working".
#3
Re: Javascript to fetch data on database
Posted 08 December 2012 - 07:43 AM
JackOfAllTrades, on 08 December 2012 - 07:36 AM, said:
Define "not working".
the script is not working.
Here is the site: http://www.mondialbh.com
When you Select Car, It will automatically fetch Model list from database. On Internet Explorer it will not fetch or working.
Thanks
#4
Re: Javascript to fetch data on database
Posted 08 December 2012 - 08:09 AM
dardime, on 08 December 2012 - 03:20 PM, said:
Hi i have created a javascript to fetch data from database
I can assure you that JavaScript doesn’t fetch anything from your database. instead PHP prefetches all types and prints it into the JS function body. a small but critical detail.
hence I suspect that IE has some problem getting the selected value. I’d try if manufacturer.value works.
#5
Re: Javascript to fetch data on database
Posted 08 December 2012 - 08:36 AM
#6
Re: Javascript to fetch data on database
Posted 08 December 2012 - 01:22 PM
dardime, on 08 December 2012 - 09:43 AM, said:
JackOfAllTrades, on 08 December 2012 - 07:36 AM, said:
Define "not working".
the script is not working.
Here is the site: http://www.mondialbh.com
When you Select Car, It will automatically fetch Model list from database. On Internet Explorer it will not fetch or working.
Thanks
Yeah, but see...not everyone USES WINDOWS. I and many other developers use Mac OS X or Linux. There is NO OPTION for using IE in those cases, unless you have Windows running in a VM on your system or in the cloud (which I'm actually sure many web developers do, I just can't be bothered for the most part). And besides that...you didn't bother to mention WHAT VERSION of IE you're experiencing this with! The different versions of IE vary wildly in their support for different web technologies.
Please read this excellent blog post from Curtis Rutland before you post on this or any other forum again so that you may be able to get prompt, accurate help.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|