You are viewing limited content. For full access, please sign in.

Question

Question

How to hide and activate auto fill button?

asked on May 30, 2017 Show version history

Hi there,

 

A very similar question was answered here, but I could not get any modified version of the posted javascript code to work.

 

What I want to happen is for the Employee Username field to be auto populated when the user stops typing. The reason for the auto fill button is because it's looking up the value of the username in a SQL database based on two values (isActivated, which is hidden, and the display name). I'd rather not have the users need to click the button if I can possibly avoid it.

 

Here's the snippet of my form (note the isActivated field is hidden):

And then some simple CSS can hide the button I'm sure.

 

Any help would be greatly appreciated! Thanks

 

0 0

Answer

SELECTED ANSWER
replied on May 31, 2017 Show version history

Hi Jonathan,

We use the autofill quite a bit ourselves.  This does require the person to move to any other field once the name is entered for it to work.  This is assuming that either .nameInput or .isActivated could change.  Here is what we would do in your case:

In the CSS section enter:   

.autofill {display: none;}

 

In the JavaScript Section enter:

// Employee Autofill 
$(document).ready(function () {
   function autofill() {
    $('.autofill').trigger('click');
  } 
  $('.nameInput, .isActivated').change(autofill);
});
// End Employee Autofill 

1 0
replied on May 31, 2017

Wonderful! Works like a charm. Thank you!

0 0
replied on May 31, 2017

You are quite welcome!

0 0
replied on July 14, 2017

FYI, the ability to hide the Autofill button as a selectable option in the Field Lookup definition was added in version 10.2

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.