正如您在下面的评论中提到的那样,您有 3 个表格,抱歉我没有意识到这一点,因为您的问题并未说明有多个表格,所以我更新了我的答案,见下文。
Javascript
<script type="text/javascript">
var order = function() {
//Check which option was selected for product_1 and re-direct
if (document.getElementById("product_1").value == "6 months"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_6months.php','_blank'); }
if (document.getElementById("product_1").value == "1 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_1year','_blank'); }
if (document.getElementById("product_1").value == "2 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_2year','_blank'); }
if (document.getElementById("product_1").value == "3 year"){ document.getElementById("product_1").value = "Select"; window.location.replace('product1_3year','_blank'); }
//Check which option was selected for product_2 and re-direct
if (document.getElementById("product_2").value == "6 months"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_6months.php','_blank'); }
if (document.getElementById("product_2").value == "1 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_1year.php','_blank'); }
if (document.getElementById("product_2").value == "2 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_2year.php','_blank'); }
if (document.getElementById("product_2").value == "3 year"){ document.getElementById("product_2").value = "Select"; window.location.replace('product2_3year.php','_blank'); }
//Check which option was selected for product_3 and re-direct
if (document.getElementById("product_3").value == "6 months"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_6months.php','_blank'); }
if (document.getElementById("product_3").value == "1 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_1year.php','_blank'); }
if (document.getElementById("product_3").value == "2 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_2year.php','_blank'); }
if (document.getElementById("product_3").value == "3 year"){ document.getElementById("product_3").value = "Select"; window.location.replace('product3_3year.php','_blank'); }
}
</script>
HTML
<form action="" method="post" name="product_1">
<select id="product_1">
<option value="Select" selected>Select</option>
<option value="6 months">6 months</option>
<option value="1 year">1 year</option>
<option value="2 year">2 year</option>
<option value="3 year">3 year</option>
</select>
</form>
<form action="" method="post" name="producs_2">
<select id="product_2">
<option value="Select" selected>Select</option>
<option value="6 months">6 months</option>
<option value="1 year">1 year</option>
<option value="2 year">2 year</option>
<option value="3 year">3 year</option>
</select>
</form>
<form action="" method="post" name="product_3">
<select id="product_3">
<option value="Select" selected>Select</option>
<option value="6 months">6 months</option>
<option value="1 year">1 year</option>
<option value="2 year">2 year</option>
<option value="3 year">3 year</option>
</select>
</form>
<input name="order" type="button" value="Order Now" onClick="order()">
例子