Encounter Provider Autocomplete doesn't work in HTML Forms

Hey,

I am trying to use <encounterProvider type=“autocomplete”/> in the html form and i am getting the following error in the console :

Uncaught TypeError: textField.autocomplete is not a function at setupOptionAutocomplete (htmlFormEntry.js:270) at HTMLInputElement.onfocus (enterHtmlFormWithStandardUi.page?patientId=6158f88b-b4d5-4f10-a4d1-02e5b86ee1c8&visitId=bacebbcc-1198-4621-921e-d720e46ef585&definitionUiResource=icrcforms:htmlforms/generalInfoForm.xml:492)

Can someone please help me with this?

Are you able to reproduce this on the demo server? http://demo.openmrs.org

So, I was able to put the statement in html forms in demo server and it worked in the preview section. I tried the same on my local instance and edited my form from manage html forms section and it worked there as well. But when i access my form normally, it gives me the error. So weird.

Do you have the same versions of modules as for the demo server?

I do… could it be, because of the jquery ui library. I looked up on google and found this link which is the probable cause jquery - TypeError: $(...).autocomplete is not a function - Stack Overflow