根據用戶的選擇,表單中有一個是或否的字段我希望根據他們的回答將它們發送到不同的感謝頁面。Javascript重定向到兩個感謝頁面,具體取決於表單響應
有了這個,我只是得到一個空白頁。我嘗試了所有我能想到的東西,所以我很欣賞任何見解。
<form action="http://www.google.com/form" name="Lead" id="Lead" class="sem-form" onsubmit="return redirectTY()">
<label class="select">
<select name="Invest_RD" id="Invest_RD">
<option value="Yes">Yes</option>
<option selected="selected" value="No">No</option>
</select>
</label>
</form>
function redirectTY(){
var qualify = document.getElementById("Invest_RD".value);
if (qualify == "Yes"){
\t window.location.href='http://www.google.com';
} else {
\t window.location.href='http://www.bing.com';
}
}
對不起,我忘了提交按鈕的代碼,但我有一個。 –