Disable the submit button when using autocomplete
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Mar 2018 20:00:55 +0000 (15:00 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 1 Mar 2018 20:00:55 +0000 (15:00 -0500)
If they use autocomplete then hit the submit they get back no results.

views/admin/contacts/index.html

index f278f30..9856f82 100644 (file)
@@ -25,7 +25,7 @@
             &nbsp;&nbsp;
             <span class="glm-nowrap">
                 <b>Text Search: </b><input  id="glmContactsSearch" name="filterText" type="text" id="autoTest" value="{$filterText}">
-                <input type="submit" value="Submit">
+                <input id="glmContactSearchSubmit" type="submit" value="Submit">
         </div>
 
         <br clear="all">
                  select: function( event, ui ) {
                      var contactID = ui.item.id;
                      var memberID = ui.item.member;
+                     // When they hit the autocomplete disable the submit button
+                     $('#glmContactSearchSubmit').prop('disabled', true);
                      window.location.replace("{$adminUrl}?page=glm-members-admin-menu-member&glm_action=contacts&option=edit&member=" + memberID + "&contact=" + contactID );
                  },
                  response: function(event, ui) {