简体   繁体   中英

SUBMIT form using post method without ajax (jquery mobile)

I'm doing login form which looks like:

<head> 
    <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
    <script src="../sp/jqm/jquery.mobile.js"></script>
    <script type="text/javascript">
    $(document).bind("mobileinit", function(){
        $.extend(  $.mobile , {
            ajaxFormsEnabled: false,
            ajaxEnabled: true
        });
    });

    </script>
    <link rel="stylesheet" href="../sp/jqm/jquery.mobile.min.css" />
</head>
<body>
    <div data-role="page" data-theme="b"> 
        <div data-role="header">
            <h1>Login</h1>
        </div> 
        <div data-role="content">
            <form action="login_act.asp" method="POST" id="frm_prijava" name="frm_prijava">
                <div data-role="fieldcontain">
                    <label for="username"> User name:</label>
                    <input type="text" name="username" id="username" value=""  />
                    <label for="pass">Password:</label>
                    <input type="password" name="pass" id="pass" value=""  />
                    <input type="submit" name="sbm" id="sbm" data-role="button" value="Enter" /> 
                </div>
            </form>
        </div> 
    </div> 
</body>

When i try to submit form, dialog pops up and nothing happens... it just loads the page...

how can I submit this form without ajax?

Try executing your mobileinit event before jQuery Mobile is loaded

The mobileinit event is triggered immediately upon execution, you'll need to bind your event handler before jQuery Mobile is loaded.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM