<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add ID to Button]]></title><description><![CDATA[<p dir="auto">is it possible to add an ID (/Identification) to an appdrag-button rather than to the appdrag-button-container via PageBuilder?</p>
]]></description><link>https://community.appdrag.com/topic/507/add-id-to-button</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 02:48:31 GMT</lastBuildDate><atom:link href="https://community.appdrag.com/topic/507.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Nov 2020 07:32:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add ID to Button on Thu, 26 Nov 2020 08:03:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a> thanks again for your help! Really appreciated!</p>
]]></description><link>https://community.appdrag.com/post/2004</link><guid isPermaLink="true">https://community.appdrag.com/post/2004</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Thu, 26 Nov 2020 08:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Wed, 25 Nov 2020 22:51:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi Dick,</p>
<p dir="auto">Based on that HTML, you don't have an actual html "button" element... you have a span element with a click() action and a rectangular background <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
<p dir="auto">The valid selector combination to select the first span inside your "message" div would be:</p>
<pre><code>document.querySelector("#message span").click()
</code></pre>
]]></description><link>https://community.appdrag.com/post/1993</link><guid isPermaLink="true">https://community.appdrag.com/post/1993</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Wed, 25 Nov 2020 22:51:43 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Wed, 25 Nov 2020 17:52:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a></p>
<pre><code>&lt;div class="appdrag-button-container ui-draggable-handle resizable-elem" style="text-align:center;margin:20px 0 0 !important;padding:0 !important" margin-desktop-top="20" margin-desktop-bottom="0" margin-desktop-left="0" margin-desktop-right="0" padding-desktop-top="0" padding-desktop-bottom="0" padding-desktop-left="0" padding-desktop-right="0" market-id="3698446" owner-id="1" btn-align="center" id="message"&gt;
                  &lt;span icon="" class="appdrag-button javascript-trigger" hover-color="#D1C4E9" hover-background-color="#673AB7" style="color: rgb(255, 255, 255); border-radius: 5px; padding: 12px 16px; font-size: 16px; font-family: Roboto; font-weight: initial; border-style: none; border-color: rgb(255, 255, 255); background: rgb(124, 77, 255);" fs-d="16" javascript-trigger="message(%22hello%22)"&gt;&lt;span&gt; Test Query Selector &lt;/span&gt;&lt;/span&gt;
                &lt;/div&gt;
</code></pre>
]]></description><link>https://community.appdrag.com/post/1990</link><guid isPermaLink="true">https://community.appdrag.com/post/1990</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Wed, 25 Nov 2020 17:52:36 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Wed, 25 Nov 2020 09:12:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/190">@Dick-Honing</a> maybe send a screenshot to your HTML to see if there is a "button" type element inside an element with the id "updateButton"</p>
]]></description><link>https://community.appdrag.com/post/1980</link><guid isPermaLink="true">https://community.appdrag.com/post/1980</guid><dc:creator><![CDATA[Wassim]]></dc:creator><pubDate>Wed, 25 Nov 2020 09:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Tue, 24 Nov 2020 15:47:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a> are you sure this selector combination is valid?</p>
<pre><code>document.querySelector("#updateButton button").click()
</code></pre>
<p dir="auto">I've tried, but I keep getting this error:</p>
<p dir="auto"><img src="/assets/uploads/files/1606232755021-screenshot-2020-11-24-at-16.45.47.png" alt="Screenshot 2020-11-24 at 16.45.47.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Thanks again for your help! I really appreciate it and hope I repay your kindness some day.</p>
]]></description><link>https://community.appdrag.com/post/1969</link><guid isPermaLink="true">https://community.appdrag.com/post/1969</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Tue, 24 Nov 2020 15:47:07 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 22:01:09 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://www.w3schools.com/cssref/css_selectors.asp" rel="nofollow ugc">https://www.w3schools.com/cssref/css_selectors.asp</a></p>
]]></description><link>https://community.appdrag.com/post/1959</link><guid isPermaLink="true">https://community.appdrag.com/post/1959</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Mon, 23 Nov 2020 22:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 21:55:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a> can you please (re-)send the lint to w3schools with the different combinations of selectors? Thanks in advance!</p>
]]></description><link>https://community.appdrag.com/post/1958</link><guid isPermaLink="true">https://community.appdrag.com/post/1958</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Mon, 23 Nov 2020 21:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 10:32:33 GMT]]></title><description><![CDATA[<p dir="auto">Exactly. You can check the link to w3 schools in my previous post for all the different combinations of selectors use can use, it's very very useful!</p>
<p dir="auto">Also, I recommend you add a feature request in the forum for binding keystrokes to buttons via PageBuilder interface. That's a great use case!</p>
]]></description><link>https://community.appdrag.com/post/1949</link><guid isPermaLink="true">https://community.appdrag.com/post/1949</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Mon, 23 Nov 2020 10:32:33 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 10:21:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a> Great tip! I'm going to try this out tonight. One more question: what would the equivalent code for the input field within the cloud backend input be?</p>
<pre><code>document.querySelector("#field input").click()
</code></pre>
<p dir="auto">?</p>
<p dir="auto">Thanks again and enjoy the rest of your day!</p>
]]></description><link>https://community.appdrag.com/post/1948</link><guid isPermaLink="true">https://community.appdrag.com/post/1948</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Mon, 23 Nov 2020 10:21:02 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 10:31:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi Dick,</p>
<p dir="auto">I think I completely understand what you're trying to do, and I'm not sure it's possible.</p>
<p dir="auto">HOWEVER - there's a better way to accomplish it besides adding the ID directly to the button.</p>
<p dir="auto">Keep the ID on the button's container, and instead of selecting just the ID, you can tell javascript to choose the first instance of a button AFTER that ID.</p>
<p dir="auto">Change any instance of getElementById</p>
<pre><code>document.getElementById("updateButton").click();
</code></pre>
<p dir="auto">to</p>
<pre><code>document.querySelector("#updateButton button").click()
</code></pre>
<p dir="auto">This selects first the container element that has the "updateButton" id, then selects the first button element contained therein.</p>
<p dir="auto"><a href="https://www.w3schools.com/cssref/css_selectors.asp" rel="nofollow ugc">https://www.w3schools.com/cssref/css_selectors.asp</a></p>
<p dir="auto">That's how I would do it with PageBuilder <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
]]></description><link>https://community.appdrag.com/post/1946</link><guid isPermaLink="true">https://community.appdrag.com/post/1946</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Mon, 23 Nov 2020 10:31:28 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 08:19:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a> thanks! And how do I ad an ID to an Cloud Backed Input's input instead of the surrounding div?</p>
]]></description><link>https://community.appdrag.com/post/1942</link><guid isPermaLink="true">https://community.appdrag.com/post/1942</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Mon, 23 Nov 2020 08:19:01 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Mon, 23 Nov 2020 07:02:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/190">@Dick-Honing</a> if you follow my guide it will add it to the button not the container.</p>
<p dir="auto">You're on the container if you have this :<br />
<img src="/assets/uploads/files/1606114859698-9689f71a-8e3d-4bea-989d-92903a4f3385-image.png" alt="9689f71a-8e3d-4bea-989d-92903a4f3385-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto">And you can switch to the button by selecting the button you want here :<br />
<img src="/assets/uploads/files/1606114934253-a8fc0c29-e5f1-4d0c-9741-74f4adf418c7-image.png" alt="a8fc0c29-e5f1-4d0c-9741-74f4adf418c7-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto">You're on the button if you have this :</p>
<p dir="auto"><img src="/assets/uploads/files/1606114896364-6b4a0c15-5329-4b6c-b3fc-f2a86aaaf763-image.png" alt="6b4a0c15-5329-4b6c-b3fc-f2a86aaaf763-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto">And you can switch to the buttons container by clicking this :<br />
<img src="/assets/uploads/files/1606114962608-3436bb85-d41a-44d8-b9a3-d9a7c911e623-image.png" alt="3436bb85-d41a-44d8-b9a3-d9a7c911e623-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>https://community.appdrag.com/post/1939</link><guid isPermaLink="true">https://community.appdrag.com/post/1939</guid><dc:creator><![CDATA[Wassim]]></dc:creator><pubDate>Mon, 23 Nov 2020 07:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Fri, 20 Nov 2020 12:29:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a> via Page Builder the ID is added to the appdrag-button-container, whereas I would like to be able to ad an ID to the appdrag-button (too).</p>
<p dir="auto"><img src="/assets/uploads/files/1605874969022-screenshot-2020-11-20-at-11.09.27.png" alt="Screenshot 2020-11-20 at 11.09.27.png" class="img-responsive img-markdown" /></p>
<p dir="auto">For a couple of reasons:</p>
<p dir="auto">... in order to run a script on a ctrl/cmd key combination, i.e.:</p>
<pre><code>document.addEventListener("keydown", function(e) {
if (e.keyCode == 83 &amp;&amp; (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
           e.preventDefault();
           //document.getElementById("updateButton").click();
           var mode = document.getElementById("mode").innerHTML;
           console.log(mode);
           if (mode == "EDIT") {
               document.getElementById("updateButton").click();
           } else {
               document.getElementById("saveButton").click();
           }
       }
   }, false)
</code></pre>
<p dir="auto">... to hide the Default value in an input field ...</p>
<pre><code>document.getElementById('productnummerInput').value = '';
</code></pre>
<p dir="auto">Now I've got to go into the code editor and I would like to avoid this as much as possible <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--wink" title=";-)" alt="😉" /></p>
]]></description><link>https://community.appdrag.com/post/1928</link><guid isPermaLink="true">https://community.appdrag.com/post/1928</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Fri, 20 Nov 2020 12:29:20 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Fri, 20 Nov 2020 07:07:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/190">@Dick-Honing</a> both of our solutions are without going to the code :</p>
<p dir="auto"><img src="/assets/uploads/files/1605855917264-5f14bfe7-5a06-4edc-b1f9-f45a2f908045-image.png" alt="5f14bfe7-5a06-4edc-b1f9-f45a2f908045-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1605855963759-397e0c4a-8d6e-4b63-9658-fb8b4012011a-image.png" alt="397e0c4a-8d6e-4b63-9658-fb8b4012011a-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1605855974862-fab6357e-5d9c-400d-87e6-d8fc85c5cb1c-image.png" alt="fab6357e-5d9c-400d-87e6-d8fc85c5cb1c-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1605855989526-daf59f4b-d522-4b10-a4f6-4db026b5f4d9-image.png" alt="daf59f4b-d522-4b10-a4f6-4db026b5f4d9-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>https://community.appdrag.com/post/1922</link><guid isPermaLink="true">https://community.appdrag.com/post/1922</guid><dc:creator><![CDATA[Wassim]]></dc:creator><pubDate>Fri, 20 Nov 2020 07:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Thu, 19 Nov 2020 13:26:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/16">@Joseph-Benguira</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a> thank you both for your tips. The thing that is unfortunately not (yet <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--wink" title=";-)" alt="😉" /> ) possible, is assigning an id to the button via the settings other than going into the source code. The reason I want to add an id to a button, is to be able to trigger this button through a script. For example when a user hits the enter key in a password field, that the login button automatically gets triggered or when the user presses ctrl-S or cmd-S that the Save button trigged fired. Again, I'm not fully up to speed in AppDrag, but this is something I'm pretty sure I'm going to be using a lot ...</p>
]]></description><link>https://community.appdrag.com/post/1918</link><guid isPermaLink="true">https://community.appdrag.com/post/1918</guid><dc:creator><![CDATA[Dick Honing]]></dc:creator><pubDate>Thu, 19 Nov 2020 13:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Thu, 19 Nov 2020 06:56:38 GMT]]></title><description><![CDATA[<p dir="auto">And, the third option =&gt;</p>
<p dir="auto">Instead of double clicking on the button you can from the buttons container use the dropdown "Open Button Edition" and select the button you want to edit.</p>
<p dir="auto"><img src="/assets/uploads/files/1605768918368-a3689e26-145c-48eb-8673-f9e85ad96923-image.png" alt="a3689e26-145c-48eb-8673-f9e85ad96923-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>https://community.appdrag.com/post/1914</link><guid isPermaLink="true">https://community.appdrag.com/post/1914</guid><dc:creator><![CDATA[Wassim]]></dc:creator><pubDate>Thu, 19 Nov 2020 06:56:38 GMT</pubDate></item><item><title><![CDATA[Reply to Add ID to Button on Wed, 18 Nov 2020 11:05:02 GMT]]></title><description><![CDATA[<p dir="auto">yes if you double click on the button, then use the back arrow and go to Identification (simple click will select the container)<br />
Another option is to edit the source code of your element and add the id there</p>
]]></description><link>https://community.appdrag.com/post/1907</link><guid isPermaLink="true">https://community.appdrag.com/post/1907</guid><dc:creator><![CDATA[Joseph Benguira]]></dc:creator><pubDate>Wed, 18 Nov 2020 11:05:02 GMT</pubDate></item></channel></rss>