如何添加在線驗證,以確保無線輸入的選擇,必須選擇添加jQuery的表單驗證Javascript?
<script type="text/javascript">
function choosePage() {
if(document.getElementById('weightloss').form1_option1.checked) {
window.location.replace("http://google.com/");
}
if(document.getElementById('weightloss').form1_option2.checked) {
window.location.replace("http://yahoo.com/");
}
}
</script>
<form id="weightloss">
<input type="radio" id="form1_option1" name="weight-loss" value="5_day" class="plan">
<label for="form1_option1"> 5 Day - All Inclusive Price</label><br>
<input type="radio" id="form1_option2" name="weight-loss" value="7_day">
<label for="form1_option2"> 7 Day - All Inclusive Price</label><br>
<input type="button" value="Place Order" alt="Submit button" class="orange_btn" onclick="choosePage()">
</form>
編輯職位,包括一個代碼塊,這樣所有的標籤出現... – LorenVS 2011-02-28 22:16:28
爲什麼你不選擇默認的收音機之一? – m1k3y3 2011-02-28 22:23:51