Google Autocomplete Error

6,340 views
Skip to first unread message

Steven Ottz

unread,
Jan 1, 2016, 3:58:39 AM1/1/16
to AngularJS
I am getting this error using Google Autocomplete

InvalidValueError: not an instance of HTMLInputElement

I am using this in my view 

<input  id="destination" ng-model="achSearch.destination"  type="text" class="form-control" required="required"/>

This is my js

var input = document.getElementById('destination');

Ted Adams

unread,
Jan 11, 2016, 6:15:32 PM1/11/16
to AngularJS
Any chance that document.getElementById() is running before the input has been created?

Nagesh Dhanashetti

unread,
Jan 12, 2016, 7:47:14 AM1/12/16
to AngularJS
You have input type text.

Google maps autocomplete now supports only window.HTMLInputElement (INPUT tag).

Please check this link on StackOverflow

Tim L

unread,
May 20, 2016, 11:10:09 AM5/20/16
to AngularJS
Thanks,

But 

<input  id="destination" ng-model="achSearch.destination"  type="text" class="form-control" required="required"/>

It's a window.HTMLInputElement (INPUT tag) no ?

Nikita Yeryomin

unread,
Feb 9, 2017, 3:26:04 AM2/9/17
to Angular and AngularJS discussion
I have same issue. Any luck with this?

Thanks,
Nikita

Nilam Khandagale

unread,
Jun 28, 2020, 2:06:48 AM6/28/20
to Angular and AngularJS discussion
Any solution getting same error?


On Friday, January 1, 2016 at 2:28:39 PM UTC+5:30, Steven Ottz wrote:
Reply all
Reply to author
Forward
0 new messages