InvalidValueError: not an instance of HTMLInputElement
See original GitHub issueI am developing an application, in Ionic, where you can plan a trip with a start address and an end address. However, I want to limit this feature to only one country. Before writing I have been searching for solutions on the internet, but none of them worked for me.
Have tried these suggestions:
https://stackoverflow.com/a/8282093/8130808
https://stackoverflow.com/a/10170421/8130808
Here is how I have tried to approach it:
I get the input from an alert dialog
newRouteInput() {
let alert = this.alertCtrl.create({
title: 'New route',
inputs: [
{
name: 'routeStart',
placeholder: 'Start of route'
},
{
name: 'routeEnd',
placeholder: 'End of route'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Debug start and end',
handler: data => {
if (data.username !== "undefined") {
console.log(data.routeStart + " " + data.routeEnd);
this.routeStart = "Malmö";
this.routeEnd = "Berlin";
this.newRoutePlaceMarks(this.map);
this.routeButton = false;
} else {
return false;
}
var input = document.getElementById(data.routeStart + " " + data.routeEnd);
var autocomplete = new google.maps.places.Autocomplete(input);
google.maps.event.addDomListener(input);
}
},
{
text: 'Place route markers',
handler: data => {
if (data.username !== "undefined") {
this.routeStart = data.routeStart;
this.routeEnd = data.routeEnd;
this.newRoutePlaceMarks(this.map);
this.routeButton = false;
} else {
console.log(data.routeStart + " " + data.routeEnd);
return false;
var input = document.getElementById(data.routeStart + " " + data.routeEnd);
var autocomplete = new google.maps.places.Autocomplete(input);
google.maps.event.addDomListener(input);
}
}
}
]
});
alert.present();
}
When I run this I get an error because of data.routeStart + " " + data.routeEnd
. What’s the solution? 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
InvalidValueError: not an instance of HTMLInputElement
Google map is producing an error. InvalidValueError: not an instance of HTMLInputElement. I tried solution given here But error still remains.
Read more >Google Maps Autocomplete InvalidValueError: not an instance ...
HTML : Google Maps Autocomplete InvalidValueError : not an instance of HTMLInputElement [ Beautify Your Computer ...
Read more >Google Autocomplete Error
InvalidValueError : not an instance of HTMLInputElement. I am using this in my view. <input id="destination" ng-model="achSearch.destination" type="text" ...
Read more >InvalidValueError: not an instance of HTMLInputElement #118
mashum commented on Dec 16, 2020. This error occur when geocode accessing the input field and the filed is not still load and...
Read more >not an instance of HTMLInputElement Google Map error
on the Geodirectory add listing page when i look at the console i see this error: InvalidValueError: not an instance of HTMLInputElement.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is that it’s not limited to only one country 😃 Anyway, thanks for trying 😄
@Hudhud Anyway I don’t really understand what’s the problem and how to help you bro 😉