Forum Moderators: open
Is the only way to accomplish something like this to completely rebuild the options list each time?
function checkcompat(event)
{
/*Does compatability checking for the page. This is still incomplete, as compat checking is needed to be done on the software also.
as well as when compatability options change the currently selected option should change to match.*/
var motherref = document.getElementById('MotherboardSel').value;
var boardcompats = mothercompat[motherref];
var orderform = document.getElementById('theorderform');
for (i = 0; i < orderform.CPU.options.length; i++) {
if (boardcompats['Socket'] == compat['CPU'][i]) {
orderform.CPU.options[i].style.display = "block";
}
else {
orderform.CPU.options[i].style.display = "none";
}
}
for (i = 0; i < orderform.Memory.options.length; i++) {
if (boardcompats['Memory'] == compat['Memory'][i]) {
orderform.Memory.options[i].style.display = "block";
}
else {
orderform.Memory.options[i].style.display = "none";
}
}
for (i = 0; i < document.getElementById('Video_CardSel').options.length; i++) {
if (compat['Video Card'][i] == "SLI" ¦¦ compat['Video Card'][i] == "Crossfire") {
var code = compat['Video Card'][i];
if (boardcompats[code] == "y") {
document.getElementById('Video_CardSel').options[i].style.display = "block";
}
else {
document.getElementById('Video_CardSel').options[i].style.display = "none";
}
}
else {
document.getElementById('Video_CardSel').style.display = "block";
}
}
return;
}
Sorry even with code tags the forums seem to eat my tabs and whitespacing