<?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 Re: Passing a string through a button in info template in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717553#M66646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What happens if you put quotes around z in the onClick?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2012 17:45:05 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2012-11-20T17:45:05Z</dc:date>
    <item>
      <title>Passing a string through a button in info template</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717552#M66645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I have an info template like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;infoTemplate=new esri.InfoTemplate("&amp;lt;div align='center'&amp;gt;&amp;lt;input type='button' value='Use this location' onclick='test(x,y,z)'&amp;gt;&amp;lt;/div&amp;gt;");&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have defined x,y,z as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;x=5;
y=10;
z="Sairam";&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting an error on my browser as " 'Sairam' is undefined".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I pass only numeric values, it works fine. But if i pass a String, i get this undefined error. Could some one tell me how i could pass a String as a parameter on this info template button onclick function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Prasanna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 17:04:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717552#M66645</guid>
      <dc:creator>PrasannaRaghavendar</dc:creator>
      <dc:date>2012-11-20T17:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a string through a button in info template</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717553#M66646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What happens if you put quotes around z in the onClick?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 17:45:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717553#M66646</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2012-11-20T17:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a string through a button in info template</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717554#M66647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi schlot,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error persists even if I put it inside quotes. I did a workaround to make it work. I globally declared a Javascript Array, stored the string in it and passed the index of the array through the info template. With that index, I can access my content from the array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Prasanna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 06:51:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-a-string-through-a-button-in-info-template/m-p/717554#M66647</guid>
      <dc:creator>PrasannaRaghavendar</dc:creator>
      <dc:date>2012-12-11T06:51:50Z</dc:date>
    </item>
  </channel>
</rss>

