Iphone默认KeyBoard“Go”按钮操作不与PhoneGap工作 [英] Iphone default KeyBoard "Go" button action not working with PhoneGap
问题描述
我使用 PhoneGap 1.8.1 在Iphone中构建应用程序。
I am using PhoneGap 1.8.1 to build an application in Iphone.
我有一个登录窗口。
有两个html文本框(一个用于输入用户名,另一个用于输入密码)和一个登录按钮登录。
There are two html Text-boxes (one for entering user name and another one for entering password) and a Log-in button to login.
我可以使用下面的代码成功登录我的登录按钮。
I can able to successfully Login through my Login button using below code.
<input type="button" value="Login" id="btnSubmit" class="blueButton" data-role="none"/>
$("#btnLogin").click(function(){
var username = $("#txtUsername").val();
var password = $("#txtPassword").val();
//do login actions ….
});
当用户在iPhone键盘上按Go按钮时,必须触发相同的登录功能。
然而,我无法触发登录按钮操作,而用户点击iOS默认键盘Go按钮。
I have to trigger the same Login functionality when user taps on iPhone Keyboard "Go" button. However , I am unable to trigger the Login button actions while user taps on the iOS default Keyboard "Go" button.
我可以注册/在PhoneGap中触发键盘Go按钮事件。
May i know how can i register/trigger the keyboard "Go" button event in PhoneGap.
找到任何好的答案那一个。
However i didn't find any good answer for that one.
有关此问题的任何帮助都是感谢。
Any help on this issue is Appreciated.
谢谢。
推荐答案
尝试使用类型的按钮提交
<input type="submit" value="Login" id="btnSubmit" class="blueButton" data-role="none"/>
或在表单提交时绑定事件
Or bind event on form submit
$("#loginForm").form(function(){
// do event prevention if required
var username = $("#txtUsername").val();
var password = $("#txtPassword").val();
//do login actions ….
});
虽然这个问题似乎与Phonegap(Cordova)没有关系,因为它应该在浏览器中工作相同。
Although this issue does not seem related to Phonegap (Cordova) as it should work same in browser as well.
这篇关于Iphone默认KeyBoard“Go”按钮操作不与PhoneGap工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!