How to refresh auto complete text box

Posted by Manorama under jQuery on 8/16/2013 | Points: 10 | Views : 2467 | Status : [Member] | Replies : 6
hi all........
I have 2 mvc pages.In One page I have Users data,in one more page i have fetch Managers list from 1st page.when i active/deactive users list in 1st page.based on this auto complete has to refresh in 2nd page....but its not refreshing.

here is my code:
$(document).ready(function () {

$('#EmailId').autocomplete({

source: '@Url.Action("ManagerAutoComplete", "ManageProjetcs")',
minLength: 3,
select: function (event, ui) {
$('#EmailId').val(ui.item.value);
},
change: function (event, ui) {

if (!ui.item) {
$(this).val('');
$('label[for=errorEmailID]').html('Select EmailID from manager list');

}
}


});
});

ManoRama


Responses

Posted by: Bandi on: 8/16/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
1) Add one more condition for checking inactive & Active users while getting Managers list...
2) First clear cache by using flushCache() and then repopulate the autocompleteTextBox
$("#txtElement").flushCache();


May be try this.. pass on remote data to autocomplete textbox
http://stackoverflow.com/questions/8530470/passing-remote-data-to-autocomplete?rq=1

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manorama on: 8/16/2013 [Member] Starter | Points: 25

Up
0
Down
thanks for reply chandu...

i tried $("#txtElement").flushCache(); i got error message as....object does not support for this method

ManoRama

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/16/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi Manorama,
$("[b]#txtElement[/b]") this highlighted name should be your autocomplete text box id

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manorama on: 8/16/2013 [Member] Starter | Points: 25

Up
0
Down
i know chandu.....

ManoRama

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Manorama on: 8/16/2013 [Member] Starter | Points: 25

Up
0
Down
Auto complete is working fine in all browsers except IE8 and 9

ManoRama

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/16/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi Manorama,
http://stackoverflow.com/questions/2823018/jquery-ui-autocomplete-not-working-in-ie8-until-page-refresh

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Manorama, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response