General developer forum

Bug with autocomplete form element

 
Picture of Andraž P.
Bug with autocomplete form element
 

I added autocomplete form element to form and set options to tags = true. When I add a long string ex. "ab cd ef gh ij kl mn op rs tu vz 12 34 56 78 90 a b c d e f g" and save, it removes some char at end "ab cd ef gh ij kl mn op rs tu vz 12 34 56 78 90 a".


Field in dababase is text and if I check, what I get from submited form, I get only part of text. Is there a workaround for this "bug"?

 
Average of ratings: -
Picture of Darko Miletić
Re: Bug with autocomplete form element
Core developersParticularly helpful Moodlers

Show us some code.

 
Average of ratings: -
Picture of Andraž P.
Re: Bug with autocomplete form element
 
Average of ratings: -
Picture of Darko Miletić
Re: Bug with autocomplete form element
Core developersParticularly helpful Moodlers

Given that you do not do custom ajax I suggest you to look into the implementation of the autocomplete functionality in javascript.

See [moodledir]/lib/amd/src/form-autocomplete.js which implements core/form-autocomplete module .


 
Average of ratings: -
Picture of Andraž P.
Re: Bug with autocomplete form element
 

Tnx, I implemented JqueryUI autocomplete and it'd working fine.

 
Average of ratings: -