<?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: How to clear textarea on click using AMD syntax in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229729#M21463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm... I've used placeholder forever and in every text widget. Never had a problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;input id="project-save-name" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, placeholder: 'Name', style: 'width:300px;'" /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Oct 2013 15:08:56 GMT</pubDate>
    <dc:creator>BenFousek</dc:creator>
    <dc:date>2013-10-08T15:08:56Z</dc:date>
    <item>
      <title>How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229724#M21458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a textarea that starts out as &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;textarea data-dojo-type="dijit/form/Textarea" id="taAddress"/&amp;gt;Enter an Address, Place or ZIP.&amp;lt;/textarea&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like for the user to be able to click on the phrase "Enter an Address, Place or ZIP", and have that automatically empty the textarea so the user can just start typing without having to delete the phrase already in there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a line which I've placed below my last function, but before the ending });&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;registry.byId("taAddress").on("click", clearTextInput('taAddress'));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and here's my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function clearTextInput (textFieldName) { &amp;nbsp;&amp;nbsp;&amp;nbsp; var txtarea = registry.byId(textFieldName); &amp;nbsp;&amp;nbsp;&amp;nbsp; txtarea.set("value", ""); }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is that this fires as the page is loading, not on the map click.&amp;nbsp; I can see it starts out with my initial phrase, but then it clears itself, even before I have a chance to actually click in the textarea.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 13:53:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229724#M21458</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-10-08T13:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229725#M21459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the &lt;/SPAN&gt;&lt;STRONG&gt;placeholder&lt;/STRONG&gt;&lt;SPAN&gt; parameter. Works for all text widgets. No extra code required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;input data-dojo-type="dijit/form/TextBox" data-dojo-props="&lt;STRONG&gt;placeholder: 'Search place or address'&lt;/STRONG&gt;" /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 14:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229725#M21459</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-10-08T14:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229726#M21460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That sounded so promising, but no go.&amp;nbsp; I'm getting a type error on my registry.byId('taAddress'), saying it's undefined.&amp;nbsp; I have included "dijit/registry" and have another 'click' for a button right below this line that works just fine with registry.byId, so 'make sure you defined in' is not the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't registry.byId work for all digits and if it's an html element like 'div', that's when you'd use dom.byId instead?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 14:30:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229726#M21460</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-10-08T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229727#M21461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This doesn't work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;textarea data-dojo-type="dijit/form/Textarea" data-dojo-props="placeholder: 'Enter an Address, Place or ZIP.'" id="taAddress"/&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you are getting the type error because you aren't wrapping in a function, but you don't need it with placeholder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;registry.byId("taAddress").on("click", &lt;STRONG&gt;function (evt) {&lt;/STRONG&gt; clearTextInput('taAddress') &lt;STRONG&gt;}&lt;/STRONG&gt;);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 14:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229727#M21461</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-10-08T14:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229728#M21462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The string from the placeholder doesn't show up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="taAddress" dojo-data-type="dijit/form/TextBox" dojo-data-props="placeholder: 'Enter an Address, Place or ZIP.'"&amp;gt;&amp;lt;/input&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229728#M21462</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-11T11:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229729#M21463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm... I've used placeholder forever and in every text widget. Never had a problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&amp;lt;input id="project-save-name" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, placeholder: 'Name', style: 'width:300px;'" /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 15:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229729#M21463</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-10-08T15:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229730#M21464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I changed it back to value=.&amp;nbsp; At least it shows the text I expect to see.&amp;nbsp; I still can't come up with a way to clear it out.&amp;nbsp; I'm getting confused about where I should define 'onClick'&amp;nbsp; Something I read said I shouldn't put any of any event code in the definition, it should all go outside in the form of registry.byId('mydijit').on('click', function);&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="taAddress" dojo-data-type="dijit/form/TextBox" value='Enter an Address, Place or ZIP' &amp;gt;&amp;lt;/input&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229730#M21464</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-11T11:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229731#M21465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, this is what worked for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="taAddress" dojo-data-type="dijit/form/TextBox" placeHolder='Enter an Address, Place or ZIP' &amp;gt;&amp;lt;/input&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 19:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229731#M21465</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-10-08T19:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear textarea on click using AMD syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229732#M21466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great. Glad you got it working.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 19:33:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-clear-textarea-on-click-using-amd-syntax/m-p/229732#M21466</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-10-08T19:33:40Z</dc:date>
    </item>
  </channel>
</rss>

