<?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 Alert call not working on a button click event. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44317#M3810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this button in an HTML file and the following JavaScript in a JS file:&lt;/P&gt;&lt;P&gt;&amp;lt;button class="btn btn-primary" name="btnFeedback" onclick="sendEmail()"&amp;gt;Submit&amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function sendEmail() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Hello");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the alert will not run when I click on the button. I receive, sendEmail is undefined. Here is the whole project where I have the code. The JavaScript file is in app/main.js&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/csergent45/streetSigns"&gt;https://github.com/csergent45/streetSigns&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 16:57:50 GMT</pubDate>
    <dc:creator>ChrisSergent</dc:creator>
    <dc:date>2015-04-29T16:57:50Z</dc:date>
    <item>
      <title>Alert call not working on a button click event.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44317#M3810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this button in an HTML file and the following JavaScript in a JS file:&lt;/P&gt;&lt;P&gt;&amp;lt;button class="btn btn-primary" name="btnFeedback" onclick="sendEmail()"&amp;gt;Submit&amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function sendEmail() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Hello");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the alert will not run when I click on the button. I receive, sendEmail is undefined. Here is the whole project where I have the code. The JavaScript file is in app/main.js&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/csergent45/streetSigns"&gt;https://github.com/csergent45/streetSigns&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 16:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44317#M3810</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-04-29T16:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Alert call not working on a button click event.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44318#M3811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general its best to avoid using &lt;A href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Event_attributes" rel="nofollow noopener noreferrer" target="_blank"&gt;event attributes&lt;/A&gt;.&amp;nbsp; Instead try using dojo/on to hook up the click event. So your code would look like this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;on(dom.byId("idForYourButton"), "click", function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp; sendEmail();
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:41:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44318#M3811</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-10T21:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Alert call not working on a button click event.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44319#M3812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Event attributes sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 18:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/alert-call-not-working-on-a-button-click-event/m-p/44319#M3812</guid>
      <dc:creator>ChrisSergent</dc:creator>
      <dc:date>2015-04-29T18:47:53Z</dc:date>
    </item>
  </channel>
</rss>

