表单滑动后提交按钮不起作用

时间:2014-05-08 15:28:19

标签: jquery html forms

嘿伙计们我目前正在处理航班预订表格,问题是当表格滑动时(使用JQuery),提交按钮不再起作用。

好的所以这里是表格HTML。很抱歉回复迟到的小伙伴。


<form id="book" action="search.php" method="POST">
        <h1>Easily Book with easyGo</h1>
            <input type="text" name="from" placeholder="From" list="city" />
            <input type="text" name="destination" placeholder="To" list="city" /><br>
            <datalist id="city">
             <option value="Istanbul/Turkey">
             <option value="Tirana/Albania">
             <option value="Andorra/Andorra">
             <option value="Dubai/AEU">
             <option value="Vienna/Austria">
             <option value="Baku/Azerbaijan">
             <option value="Berlin/Germany">
             <option value="Athens/Greece">
             <option value="Pristina/Kosovo">
             <option value="Amsterdam/Netherlands">
             <option value="Lisbon/Portugal">
             <option value="Moscow/Russia">
             <option value="Madrid/Spain">
             <option value="Ankara/Turkey">
             <option value="London/United Kingdom">
             <option value="Paris/France">
             <option value="Algiers/Algeria">
             <option value="Cairo/Egypt">
             <option value="Addis Ababa/Ethiopia">
             <option value="Nairobi/Kenya">
             <option value="Dakar/Senegal">
             <option value="Bamako/Mali">
             <option value="Kuala Lumpur/Malaysia">
             <option value="Riyadh/Saudi Arabia">
             <option value="Doha/Qatar">
             <option value="Tunis/Tunisia">
             <option value="New Delhi/India">
             <option value="Kuwait City/Kuwait">
             <option value="Rio de Janeiro/Brazil">
             <option value="Washigton DC/US">
            </datalist>
            <span id="radioTrip">
    <label><input type="radio" name="trip" value="round" class="tripType" checked="true">Round Trip</label>
    <label><input type="radio" name="trip" value="oneWay" class="tripType">One Way</label>
            </span><br><br>
            <label for="departDate">Departure Date</label>
            <input type="date" name="departDate" required><br>
            <div id="hideDiv">
            <label for="return" id="labelReturn">Return Date</label>
            <input type="date" id="return" name="returnDate" required><br>
            </div>
            <label for="adults">Adults</label>
            <select name="adult">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select>
            <label for="children">Children</label>
            <select name="children">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select>
            <label for="kids">Kids</label>
            <select name="kids">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select><br><br>
            <label for="direct">Direct Flights</label>
            <input type="checkbox" name="direct" value="direct_flight" /><br><br>
            <input type="submit" name="search" value="Search Flight" />
        </form>


$(document).ready(function () {
    $(".tripType").click(function () {
        if ($('input[name=trip]:checked').val() == "oneWay") {
            $("#hideDiv").slideUp("slow"); //Slide Down Effect
            $("#book").animate({
                height: '510px'
            }, 500);
        } else {
            $("#hideDiv").slideDown("slow"); //Slide Up Effect
            $("#book").animate({
                height: '+=60px'
            }, 500);
        }
    });
});

0 个答案:

没有答案