jQuery Autocomplete Failed
-
Hello,
I am having a challenge of using jQueryAutoComplete in my webforms. The problem is when I have selected an item from the suggested items in the textbox, fill other form fields as required, then submits the form, every is fine. But I cannot get the autocomplete working anylonger to process a new entry. What could have been the course of this? See how I did it
<link rel="stylesheet" type="text/css" href="../../Styles/jquery.autocomplete.css" />
<script src="../../Scripts/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
<script src="../../Scripts/jquery.autocomplete.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=staffNameTextBox.ClientID%>").autocomplete('../../AutoSuggest/SuggestStaffName.ashx');
});
</script> -
Hello,
I am having a challenge of using jQueryAutoComplete in my webforms. The problem is when I have selected an item from the suggested items in the textbox, fill other form fields as required, then submits the form, every is fine. But I cannot get the autocomplete working anylonger to process a new entry. What could have been the course of this? See how I did it
<link rel="stylesheet" type="text/css" href="../../Styles/jquery.autocomplete.css" />
<script src="../../Scripts/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
<script src="../../Scripts/jquery.autocomplete.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=staffNameTextBox.ClientID%>").autocomplete('../../AutoSuggest/SuggestStaffName.ashx');
});
</script>Will it work after you refresh the page manually?
-
Hello,
I am having a challenge of using jQueryAutoComplete in my webforms. The problem is when I have selected an item from the suggested items in the textbox, fill other form fields as required, then submits the form, every is fine. But I cannot get the autocomplete working anylonger to process a new entry. What could have been the course of this? See how I did it
<link rel="stylesheet" type="text/css" href="../../Styles/jquery.autocomplete.css" />
<script src="../../Scripts/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
<script src="../../Scripts/jquery.autocomplete.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=staffNameTextBox.ClientID%>").autocomplete('../../AutoSuggest/SuggestStaffName.ashx');
});
</script>The Dom wasn't ready after the postback, thus the conditional statement which roughly states if DOM is ready then run autocomplete.
$(document).ready(function () {
I suspect that you loaded your JQuery in the wrong section, probably needs to be inside the body or form tags, at the bottom after the textbox objects are created, so the Jquery has something to attach to.
-
Will it work after you refresh the page manually?
No. It only works once and after postback, it stops working
-
The Dom wasn't ready after the postback, thus the conditional statement which roughly states if DOM is ready then run autocomplete.
$(document).ready(function () {
I suspect that you loaded your JQuery in the wrong section, probably needs to be inside the body or form tags, at the bottom after the textbox objects are created, so the Jquery has something to attach to.
Okay, I will try your suggestion. Thanks.
-
Okay, I will try your suggestion. Thanks.