我对javascript很陌生,所以这对某些人来说可能很容易。我正在尝试根据访问者是否选择选项“0 到 120,000”和“选项 0 到 6 个月”来生成感谢信息。对此的任何帮助将不胜感激。
function redirect() {
var businessrev = document.getElementById("annual_business_revenue");
var time = document.getElementById("Time")
for (var i = 0; i < selections.options.length; i++) {
if ((businessrev.options[i].selected == 1) && (time.options[i].selected == 1)) {
location.href = "http://www.bing.com";
} else {
location.href = "http://www.google.com";
}
}
}
<form action="javascript:redirect();">
<select name="annual_business_revenue">
<option value="revenue1">0 to 120,000</option>
<option value="revenue2">NOT 0 to 120,000</option>
</select>
<select name="Time">
<option value="time1">0 to 6months</option>
<option value="time2">NOT 0 to 6months</option>
</select>
<input type="submit" value="Submit" />
</form>