<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic toggling function on and off in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggling-function-on-and-off/m-p/40220#M3462</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a function that will allow me to turn a function off with a checkbox.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;jQuery("#centeronCurrentLocationCheckBox").change(function() {
&amp;nbsp; if(showLocation == 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 1;
&amp;nbsp;&amp;nbsp; }else{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 0;
&amp;nbsp;&amp;nbsp; alert("hi");
&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another working checkbox that does the same as this, so I thought I would recreate it with just different titles for the function and id name.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also created a event handler function for this as well, but when I did, my map did not show up at all and I got an error that was located in the arcgis javascript api. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any suggestions as to how to create the code to turn this function on and off?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2012 15:35:57 GMT</pubDate>
    <dc:creator>ChrisBerryman1</dc:creator>
    <dc:date>2012-06-29T15:35:57Z</dc:date>
    <item>
      <title>toggling function on and off</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggling-function-on-and-off/m-p/40220#M3462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a function that will allow me to turn a function off with a checkbox.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;jQuery("#centeronCurrentLocationCheckBox").change(function() {
&amp;nbsp; if(showLocation == 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 1;
&amp;nbsp;&amp;nbsp; }else{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 0;
&amp;nbsp;&amp;nbsp; alert("hi");
&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another working checkbox that does the same as this, so I thought I would recreate it with just different titles for the function and id name.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also created a event handler function for this as well, but when I did, my map did not show up at all and I got an error that was located in the arcgis javascript api. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any suggestions as to how to create the code to turn this function on and off?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 15:35:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggling-function-on-and-off/m-p/40220#M3462</guid>
      <dc:creator>ChrisBerryman1</dc:creator>
      <dc:date>2012-06-29T15:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: toggling function on and off</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggling-function-on-and-off/m-p/40221#M3463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to write a function that will allow me to turn a function off with a checkbox.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;here is my code:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;jQuery("#centeronCurrentLocationCheckBox").change(function() {
&amp;nbsp; if(showLocation == 0){
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 1;
&amp;nbsp;&amp;nbsp; }else{ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; showLocation = 0;
&amp;nbsp;&amp;nbsp; alert("hi");
&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }); &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I have another working checkbox that does the same as this, so I thought I would recreate it with just different titles for the function and id name.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I also created a event handler function for this as well, but when I did, my map did not show up at all and I got an error that was located in the arcgis javascript api. &lt;BR /&gt;&lt;BR /&gt;any suggestions as to how to create the code to turn this function on and off?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why just use onchange handler with a variable to handler the situation using return statment? something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function checkboxChanged(sender, evt)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if variable...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // equal to cancel
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do something...
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:34:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggling-function-on-and-off/m-p/40221#M3463</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-10T21:34:05Z</dc:date>
    </item>
  </channel>
</rss>

