question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidValueError: not an instance of HTMLInputElement

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Hudhudcommented, Jun 14, 2017

The problem is that it’s not limited to only one country 😃 Anyway, thanks for trying 😄

0reactions
ErrorProcommented, Jun 14, 2017

@Hudhud Anyway I don’t really understand what’s the problem and how to help you bro 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found