0
<select name="cmbpgCategory" id="cmbpgCategory">
<option value="" label="Select" selected="selected">Select</option>
<option value="CreditCards" label="Credit Cards">Credit Cards</option>
<option value="DebitCards" label="Debit Cards">Debit Cards</option>
<option value="NetBanking" label="Net Banking">Net Banking</option>
</select>

在上面的代码中,如果用户选择信用卡等选项,则页面应重定向到信用卡页面,该表单中的其他字段应发布到 nxt 页面,如姓名电子邮件等,这应该在单击按钮后<button value='seatselect' type="submit" >Confirm Booking</button>

4

1 回答 1

0

您的带有脚本代码的 HTML 页面:

<html>
<body>
<select name="cmbpgCategory" id="cmbpgCategory">
<option value="" label="Select" selected="selected">Select</option>
<option value="CreditCards" label="Credit Cards">Credit Cards</option>
<option value="DebitCards" label="Debit Cards">Debit Cards</option>
<option value="NetBanking" label="Net Banking">Net Banking</option>
</select>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<script>
$(document).ready(function() {
    $('#cmbpgCategory').bind('change', function () {
        var cardType = $('#cmbpgCategory').val();//you will get CreditCard, debitcards values here
        switch(cardType)
        {
            case 'CreditCards': window.location.href = 'creditcard.php';
            //more cases to follow?, put break
        }   
    });
});
</script>
</body>
</html>
于 2013-02-10T11:26:40.433 回答