I have an application built in Html5 and wrapped in PhoneGap for Android
I have an auto-plete input
On a puter auto-plete input works great!
In SmartPhone, the auto-plete works only after you make space on the Input
(If write numbers first - works! If letters - works only after space)
Why?
JS code:
//Run in document.ready
function AutoComplete() {
List = $.map(data.XXX, function (item) {
return {
label: item.X,
value: item.XX
};
});
$("#MyInput").autoplete({
source: List,
link: '#',
target: $('#MyList'),
minLength: 1
});
}
HTML:
The input:
<input id="MyInput" type="text"
placeholder="XXX" />
The List:
<ul id="MyList" data-role="listview" data-inset="true"> </ul>
I have an application built in Html5 and wrapped in PhoneGap for Android
I have an auto-plete input
On a puter auto-plete input works great!
In SmartPhone, the auto-plete works only after you make space on the Input
(If write numbers first - works! If letters - works only after space)
Why?
JS code:
//Run in document.ready
function AutoComplete() {
List = $.map(data.XXX, function (item) {
return {
label: item.X,
value: item.XX
};
});
$("#MyInput").autoplete({
source: List,
link: '#',
target: $('#MyList'),
minLength: 1
});
}
HTML:
The input:
<input id="MyInput" type="text"
placeholder="XXX" />
The List:
<ul id="MyList" data-role="listview" data-inset="true"> </ul>
Share
Improve this question
edited Dec 20, 2012 at 12:06
dilix
3,8933 gold badges33 silver badges58 bronze badges
asked Dec 20, 2012 at 11:31
Hodaya ShalomHodaya Shalom
4,41713 gold badges60 silver badges115 bronze badges
4
- it probably conflicts with the auto plete in the android keyboard – Stephan Celis Commented Dec 20, 2012 at 11:49
- 1 You got me then. Maybe try adding it to the <form> tag as well. – Raymond Camden Commented Dec 20, 2012 at 15:45
- 1 I do not have a tag <from>, and I did not understand what to add to this tag .. – Hodaya Shalom Commented Dec 23, 2012 at 6:34
-
1
In Android, auto plete text view has
android:pletionThreshold
property to set. Android wouldn' t start auto pletion until this threshold reached. I know you are not using Android' s auto plete text view, but your problem must be something related to this fact. I think you should try setting this parameter somewhere. – Alpay Commented Jan 4, 2013 at 14:04
4 Answers
Reset to default 5Try adding autoplete="off" to the input tag.
I am not sure ,but try after giving
minlength :0
and execute the autoplete on keypress
may be this will give u output.
have a look at these links also
- link1
- link2
I think this link solves your issue showing how to Getting jQueryUi Autoplete to work with jQueryMobile
This answer allows you to use autoplete function of jQuery on jQueryMobile solutions.
'oninput' event in the input, ran the following function:
function RefreshAutoComplete(elm) {
elm.keyup();
elm.focus();
}
I run the auto plete manually, and it works
Thank you all for the help