Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Phonegap/jQuery移动表单提交按钮在键盘显示时不响应单击_Javascript_Jquery_Ios_Cordova_Submit Button - Fatal编程技术网

Javascript Phonegap/jQuery移动表单提交按钮在键盘显示时不响应单击

Javascript Phonegap/jQuery移动表单提交按钮在键盘显示时不响应单击,javascript,jquery,ios,cordova,submit-button,Javascript,Jquery,Ios,Cordova,Submit Button,我使用phonegap+jQuery mobile创建了一个iOS项目。我有一个带有提交按钮的简单表单,如下所示: <div data-role="content"> <form id="loginForm"> <div data-role="fieldcontain" class="ui-hide-label">

我使用phonegap+jQuery mobile创建了一个iOS项目。我有一个带有提交按钮的简单表单,如下所示:

            <div data-role="content">

                <form id="loginForm">
                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="username">Username:</label>
                        <input type="text" name="username" id="username" value="" placeholder="Username" />
                    </div>

                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="password">Password:</label>
                        <input type="password" name="password" id="password" value="" placeholder="Password" />
                    </div>

                    <input type="submit" value="Login" id="submitButton">
                </form>
                <br>
                <div id="register"><a href="#registerPage" data-transition="slide">Register?</a></div>                   
            </div>            
    </div></body>
键盘的“Go”功能或enter功能运行得很好,但是当我在键盘显示时单击submit按钮时,页面被一些白块卡住了

            <div data-role="content">

                <form id="loginForm">
                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="username">Username:</label>
                        <input type="text" name="username" id="username" value="" placeholder="Username" />
                    </div>

                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="password">Password:</label>
                        <input type="password" name="password" id="password" value="" placeholder="Password" />
                    </div>

                    <input type="submit" value="Login" id="submitButton">
                </form>
                <br>
                <div id="register"><a href="#registerPage" data-transition="slide">Register?</a></div>                   
            </div>            
    </div></body>

我需要在页面中上下滑动以使其返回正常视图。就好像什么都没发生,只是把键盘关掉了。这是jQuery的正常行为吗?任何人都有解决此问题的解决方案吗?

尝试在deviceready事件侦听器中将true更改为false。
            <div data-role="content">

                <form id="loginForm">
                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="username">Username:</label>
                        <input type="text" name="username" id="username" value="" placeholder="Username" />
                    </div>

                    <div data-role="fieldcontain" class="ui-hide-label">
                        <label for="password">Password:</label>
                        <input type="password" name="password" id="password" value="" placeholder="Password" />
                    </div>

                    <input type="submit" value="Login" id="submitButton">
                </form>
                <br>
                <div id="register"><a href="#registerPage" data-transition="slide">Register?</a></div>                   
            </div>            
    </div></body>