function setParentCatId(){ var index = document.giftSelector.productType.selectedIndex; var value = document.giftSelector.productType.options[index].value; document.giftSelector.pCatId.value=value; document.giftSelector.subCatId.value="-1"; document.giftSelector.priceRange.value="-1"; document.giftSelector.submit(); } function setSubCatId(){ var parentCatIdIndex = document.giftSelector.productType.selectedIndex; var materialcatIdIndex = document.giftSelector.materialType.selectedIndex; var parentCatIdValue = document.giftSelector.productType.options[parentCatIdIndex].value; var subCatIdValue = document.giftSelector.materialType.options[materialcatIdIndex].value; document.giftSelector.pCatId.value=parentCatIdValue; document.giftSelector.subCatId.value=subCatIdValue; //document.giftSelector.priceRange.value="-1"; document.giftSelector.submit(); } function submit(){ var category = document.giftSelector.productType.selectedIndex; var material = document.giftSelector.materialType.selectedIndex; var catValue = document.giftSelector.productType.options[category].value; var materialValue = document.giftSelector.materialType.options[material].value; if((catValue>0)&&(materialValue<0)){ document.giftSelector.priceRange.value="-1"; document.giftSelector.subCatId.value="-1"; //alert("catValue=" + catValue + " materialvalue=" + materialValue); document.giftSelector.haveError.value = "true"; }else if(catValue < 0){ document.giftSelector.priceRange.value="-1"; document.giftSelector.subCatId.value="-1"; document.giftSelector.pCatId.value="-1"; } document.giftSelector.submit(); }