开发者

jQuery Mobile with my Contact Form

Can't get jquery mobile to work with my contact form.

Have validation using jquery.validate.js. If I use this, the select menu does not work on mobile.

Also on Submit, it gives "error loading page".

These are the JS and CSS files being used in this order. Please help

    <script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script>
    <script src="/about/js/jquery.validate.js"></script>
    <script src="/about/js/jquery.placeholder.js"></script>
    <script src="/about/js/jquery.form.js"></script>
    <script type="text/javascript" src="mobile/mobile.js"></script>
    <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
    <link rel="stylesheet" media="screen" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />
    <link rel="stylesheet" href="/mobile.css" media="screen" charset="utf-8">
    <link rel="shortcut icon" href="/favicon.ico"></link>

Here's my Form.

<form id="contact" action="/about/process" method="post">
    <div data-role="fieldcontain"><label for="name">Name:</label>
    <input type="text" class="required" name="name" placeholder="Your Nam开发者_JS百科e" value="" id="name"></div>
    <div data-role="fieldcontain"><label for="phone">Phone:</label>
    <input type="text" class="required" name="phone" placeholder="678-555-1212" value="" id="phone"></div>
    <div data-role="fieldcontain"><label for="email">Email:</label>
    <input type="text" class="required email" name="email" placeholder="yourname@domain.com" value="" id="email"></div>

    <div data-role="fieldcontain">
        <label for="interestedIn">Interested In:</label>
        <select name="interestedIn" class="required" id="interestedIn">
        <option value="">Select One</option>
        <option value="Karate">Karate</option>
        <option value="Tai Chi">Tai Chi</option>
        <option value="Martial Arts">Martial Arts</option>
        </select>
    </div>

    <input type="submit" class="button_text" value="Send"><br />
</form>


JQuery validate doesn't work with select elements - or more realistically, it may sort-of work but not behave as you would expect, which I think is what you are experiencing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜