I am building a form with Javascript that will build a part number and price. I need to set it up so that certain options only show for specific sizes. For example: if (size<5) hide these 3 options. The productsize is an option select but I also need to expand it to read if (productsize<5 || custom<5) then hide the div id"opt".

I've tried this:
function showopt(){
var sizeIndex=partform.size.selectedIndex
partform.size.value=partform.size.options[sizeIndex].value;
if (partform.size.options[sizeIndex].value<5) {
partform.opt.style.visibility='hidden';
document.getElementById('opt').style.visibility='hidden';
} else {
paratform.opt.style.visibility='visible';
document.getElementById('opt').style.visibility='visible';
}
}

Where opt is the id for a <DIV> but it is not working. (I added onchange="showopt();" for the field id size)

Any ideas where I'm going wrong?