Post by Nsaneone » Sat Jan 15, 2022 12:40 am

Good Afternoon All. Hope your well.

I wanted to run this issue by you, any assistance is appreciated. I am setting up an JQuery Autocomplete on an input field. However the JQuery options such as minLength or delay, dont seem to be having any affect on the input. It even returns a list when the field is empty. Is there something I am missing in getting these options to work, or do I need to use JQuery UI. Thanks in advance. Example code below:

$('#input-payment-contactname').autocomplete({

'delay': 4000,
'minLength': 10,
'source': function(request, response) {
$.ajax({
url: '/db/phpfile.php?t='+$.now()+'&filter='+encodeURIComponent(request),
dataType: 'json',
success: function(json) {
response($.map(json, function(return) {

}));
}
});
},
'select': function(ui) {

},
'response': function(ui) {

}
else
$(this).removeClass("isrequired");
},
'focus': function(event, ui) {
return false;
},
'change': function(event, ui) {

}
});

I used exaggerated values in testing to confirm that it really isn't doing anything.
Last edited by Nsaneone on Tue Jan 18, 2022 12:36 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am

Post by Nsaneone » Tue Jan 18, 2022 12:36 am

Good afternoon All. Just wanted to update my progress for the sake of completion. Learned that despite using Jquery Library, the Autocomplete function was being overwritten by one in another file (I assume this is to ensure functionality regardless of Jquery UI). The Auto complete function definition was in a file called common.js. Added the required parameters and updated the functionality. Hope this helps someone going forward.

Newbie

Posts

Joined
Thu Jan 13, 2022 12:24 am
Who is online

Users browsing this forum: No registered users and 118 guests