Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:38:51+00:00 2026-06-09T00:38:51+00:00

I have this part of code. I want to put marker, when text in

  • 0

I have this part of code.
I want to put marker, when text in textbox will change – it works with function changeValue() – getting new address.

Then, I want to put this marker, when address variable will change. How do to it?

I tried with this code below, but I get this error:
Error: ReferenceError: changeValue is not defined
What is wrong?

     (...)
    <asp:TextBox Style="width: 300px;" runat="server" ID="tbStreet" onchange="changeValue()"></asp:TextBox>
     (...) // more 5 textboxes

   <script type='text/javascript'>
          (...) // 2 long string arrays.

        var address;
        function mapaStart() {
            var wspolrzedne = new google.maps.LatLng(52.22105994970536, 19.22609921875007);
            var opcjeMapy = {
                zoom: 5,
                center: wspolrzedne,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById("mapka"), opcjeMapy);


        function changeValue() {

            var ulica;
            var miasto;
            var woj1;
            var panstwo1;
            ulica = document.getElementById("<%=tbStreet.ClientID%>").value;
            miasto = document.getElementById("<%=tbCity.ClientID%>").value;
            woj1 = woj[document.getElementById("<%=ddlProvince.ClientID%>").value];
            panstwo1 = panstwa[document.getElementById("<%=ddlCountry.ClientID%>").value];
            address = panstwo1 + ", " + woj1 + ", " + miasto + ", " + ulica;
            alert(address);
        }   
            var geokoder = new google.maps.Geocoder();
            map.setCenter(address.geometry.location);
            var marker = new google.maps.Marker(
                {
                    map: map,
                    position: address.geometry.location,
                }
            );

        } 

    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:38:52+00:00Added an answer on June 9, 2026 at 12:38 am

    Your changeValue function is local to the mapaStart function. It is not accessible in the global context that HTML click/onchange listeners run in. To make it global, move it outside of the mapaStart function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this part of code in my functions.php: function cc_admin_enqueue_scripts($hook) { $file_dir=get_bloginfo('template_directory'); wp_enqueue_script('media-upload');
We have this anonymous function in our code, which is part of the jQuery's
i have this simple question please. I have this part of code which sets
I have this code to run a slideshow (this is only part of what
So I have a program which runs. This is part of the code: FileName
I have this part of the function : $jQ('.product-collateral .product-tabs li').each(function(index){ $jQ(this).attr('id', $jQ(this).find('h3').attr('class')); if(index
I have this part of script from my GAE application which uses webapp2, which
Ok, so basically I have this part of the .htaccess partly working, but not
I have this sudden out of the blue requirement for extending a part of
I have been putting off developing this part of my app for sometime purely

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.