</select> | <select name="model" size="1" id="model" style="width:150px"></select>
<script language="javascript">
navigator.appName;
var arr = new Array();
arr[0] = new Array("HP","HP1234","HPDV5228TX","HPDV2001TX");
arr[1] = new Array("ASUS","A8H","F3S");
arr[2] = new Array("ACER","Aspire4530","Aspire4935","Aspire3810T","TravelMate6493");
var IE = false;
var FF = false;
if (navigator.appName.indexOf("Microsoft") == 0) {
IE = true;
} else if (navigator.appName.indexOf("Netscape") == 0) {
FF = true;
}
function auto_select() {
while(document.getElementById("model").length > 0) {
document.getElementById("model").remove(0);
}
var si = document.getElementById("brand").selectedIndex;
if (FF) {
for (i = 1; i < arr[si].length; i++) {
document.getElementById("model").add(new Option(arr[si][i],arr[si][i]),null);
}
} else {
var newOption;
for (i = 0; i < arr[si].length; i++) {
newOption = document.createElement("option");
newOption.text = newOption.value = arr[si][i];
document.getElementById("model").add(newOption);
}
}
}
function initial() {
if (FF) {
for (i = 0; i < arr.length; i++) {
document.getElementById("brand").add(new Option(arr[i][0],arr[i][0]),null);
}
} else {
var newOption;
for (i = 0; i < arr.length; i++) {
newOption = document.createElement("option");
newOption.text = newOption.value = arr[i][0];
document.getElementById("brand").add(newOption);
}
}
document.getElementById("brand").options[0].selected = true;
}
initial();
auto_select();
</script>
i want to update data in sql that have list menu that are using javascript code..how can i display the original data in the list menu before update??how to combine with php code??
May 24 2009, 10:17 AM, updated 17y ago
Quote
0.0171sec
0.30
5 queries
GZIP Disabled