Javascript Phonegap/jQuery移动表单提交按钮在键盘显示时不响应单击
我使用phonegap+jQuery mobile创建了一个iOS项目。我有一个带有提交按钮的简单表单,如下所示: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">
<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>