EzDevInfo.com

autocomplete interview questions

Top autocomplete frequently asked interview questions

How do you disable browser Autocomplete on web form field / input tag?

How do you disable autocomplete in the major browsers for a specific input (or form field)?


Source: (StackOverflow)

jQuery autocomplete tagging plug-in like StackOverflow's input tags?

What solutions accomplish the same auto-completion that SO uses for entering tags?

There are plugins that can handle one word but I haven't seen any that handle multiple words.


Source: (StackOverflow)

Advertisements

Removing input background colour for Chrome autocomplete?

On a form I'm working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour to a pale yellow colour.

The design I'm working on is using light text on a dark background, so this really messes up the look of the form - I have stark yellow boxes and near-invisible white text. Once the field is focused, the fields return to normal.

Is it possible to stop Chrome changing the colour of these fields?


Source: (StackOverflow)

How do I get bash completion to work with aliases?

Case in point:

I'm a on mac with bash v3.2.17, I'm using git installed via macports with the bash_completion variant.

When I type git checkout m<tab>. for example, I get it completed to master.

However, I've got an alias to git checkout, gco. When I type gco m<tab>, I don't get the branch name autocompleted.

Ideally I'd like autocompletion to just magically work for all my aliases. Is it possible? Failing that, I'd like to manually customize it for each alias. So, how do I go about either?


Source: (StackOverflow)

How can one close HTML tags in Vim quickly?

It's been a while since I've had to do any HTML-like code in Vim, but recently I came across this again. Say I'm doing a simple bit of a HTML page:

<html><head><title>This is a title</title></head></html>

How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that does not involve me going through writing them all down one by one. Of course I can use CtrlP to autocomplete the individual tag names but what gets me on my laptop keyboard is actually getting the brackets and slash right.


Source: (StackOverflow)

Disable browser 'Save Password' functionality

One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don't get me wrong, I'm all for doing everything possible to protect people's personal information (health, financial, surfing habits, etc.), but sometimes people get a little too jumpy.

Case in point: One of our state customers recently found out that the browser provides the handy feature to save your password. We all know that it has been there for a while and is completely optional and is up to the end user to decide whether or not it is a smart decision to use or not. However, there is a bit of an uproar at the moment and we are being demanded to find a way to disable that functionality for our site.

Question: Is there a way for a site to tell the browser not to offer to remember passwords? I've been around web development a long time but don't know that I have come across that before.

Any help is appreciated.


Source: (StackOverflow)

UltiSnips and YouCompleteMe

I have bundles ultisnips and youcompleteme installed on my macvim. The problem is that ultisnips doesn't work because tab is bound by ycm. I tried putting let g:UltiSnipsExpandTrigger = "<s-tab>" so that I can trigger the snippet completion with shift-tab, but it doesn't work for some unknown reason. I could use caps as the trigger, but so far I've found no way to do that.

Do any of you use those two add-ons together? What can I do to make shift-tab work? Can you recommend another key to trigger snippets?


Source: (StackOverflow)

Chrome Browser Ignoring AutoComplete=Off

I've created a web application which uses a tagbox drop down, this works great in all browsers except my preferred browser Chrome (Version 21.0.1180.89).

Despite both the input field AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.


Source: (StackOverflow)

Using HTML in jQuery UI autocomplete

Before jQuery UI 1.8.4 I could use HTML in the JSON array I built to work with an autocomplete.

I was able to do something like:

$row_array['label'] = '<span style="color: red; font-family: courier;">User, Name</span>';

That would show up as red text in the drop down.

As of 1.8.4 that does not work. I found http://dev.jqueryui.com/ticket/5275 which tells me to use the custom HTML example here which I have had no luck with.

How can I go about getting HTML to show up in the suggestion?

My jQuery is:

<script type="text/javascript">
    $(function() {
        $("#findUserIdDisplay").autocomplete({
            source: "ui_autocomplete_users_withuname.php",
            minLength: 2,
            select: function(event, ui) {
                $('#findUserId').val(ui.item.id);
            }
        });
    });
</script>

My JSON array includes HTML like the following:

[{"label":"<span style="color: red";>User, Name</span>","value":"User, Name","id":"10"}]

Source: (StackOverflow)

How can I enable auto complete support in Notepad++?

I am trying to add simple syntax highlighting and auto completion for a simple scripting language...

I added syntax highlighting using this article

Now I want to know how to enable auto completion with Notepad ++ for my custom language. Does anyone know how to do that?


Source: (StackOverflow)

How to remove/change JQuery UI Autocomplete Helper text?

It seems that this is a new feature in JQuery UI 1.9.0, because I used JQuery UI plenty of times before and this text never poped up.

Couldn't find anything related on the API documentation.

So using an basic autocomplete example with local source

$( "#find-subj" ).autocomplete({
    source: availableTags
});

When the search matches it shows this related helper text:

'1 result is available, use up and down arrow keys to navigate.'

How can I disable it in a nice way, not by removing it with JQuery selectors.


Source: (StackOverflow)

Intellij IDEA show javadoc automatically

When I am coding at Netbeans it autocompletes the code and show Javadocs. However when I am using Intellij IDEA if I click Ctrl+Space I can see the auto-complete and if I click Ctrl+Q I can see the javadoc seperately.

Is it possible to see the Javadoc of element whenever I see auto-complete or click Ctrl+Space at Intellij IDEA as like Netbeans?


Source: (StackOverflow)

jQuery UI Autocomplete widget search configuration

I'm looking into using the jQuery UI autocomplete widget to implement user lookup by first or last name. It looks like by default autocomplete looks up words by character sequence no matter its occurrence in a word. So if you have data such as: javascript, asp, haskell and you type in 'as' you will get all three. I would like it to at least match beginning of the word. So in above example you get only 'asp'. Is there a way to configure the autocomplete widget to do this?

Ultimately it would be even better to match by beginning of first or last name like it is in Gmail.

Note: I'm trying to figure out a way to do this using the jQuery UI widget specifically. Since I'm already using jQuery UI in my project, I'm planning to stick with it and try not adding additional libraries to my web application.


Source: (StackOverflow)

Disable IntelliJ Starred (Package) Imports?

I'm a migrating Eclipse IDE user and am learning my way round IntelliJ IDEA 9.

By default Eclipse IDE won't use a starred import until you import 99 classes from the same package, so it practically never happens.

But IntelliJ IDEA seems only too keen to do it, and I can't work out how to disable it.

For example, after typing JList then ALT + ENTER to auto-import, the whole javax.swing package is imported instead of just the class I specify.

I tried excluding javax.swing from the auto-completion, but that just stops any Swing classes from being suggested, which is counter-productive.


Source: (StackOverflow)

Bind jQuery UI autocomplete using .live()

I've searched everywhere, but I can't seem to find any help...

I have some textboxes that are created dynamically via JS, so I need to bind all of their classes to an autocomplete. As a result, I need to use the new .live() option.

As an example, to bind all items with a class of .foo now and future created:

$('.foo').live('click', function(){
  alert('clicked');
});

It takes (and behaves) the same as .bind(). However, I want to bind an autocomplete...

This doesn't work:

$('.foo').live('autocomplete', function(event, ui){
  source: 'url.php' // (surpressed other arguments)
});

How can I use .live() to bind autocomplete?

UPDATE

Figured it out with Framer:

$(function(){
  $('.search').live('keyup.autocomplete', function(){
    $(this).autocomplete({
      source : 'url.php'
    });
  });
});

Source: (StackOverflow)