What is “Google Suggest” or “Autocomplete”?

What is “Google Suggest” or “Autocomplete”?

asp.net – JQuery autocomplete não funciona no Chrome

criei uma pagina aspx (sim, asp.net, sistema antigo) para fazer um campo texto com autocomplete. O problema é que somente no Chrome ele não seta o valor selecionado, alguém tem uma ideia do que possa ser?

Segue o código aspx:

<script src="https://pt.stackoverflow.com/Scripts/jquery-3.5.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.12.1.min.js" type="text/javascript"></script>
<link href="Scripts/jquery-ui.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
        $("#txtProcurar").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: '<%=ResolveUrl("~/Consulta.aspx/GetClientes") %>',
                    data: "{ 'prefixo': '" + request.term + "'}",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    success: function (data) {
                        response($.map(data.d, function (item) {
                            return {
                                label: item.split('-')(0),
                                val: item.split('-')(1)
                            }
                        }))
                    },
                    error: function (response) {
                        alert(response.responseText);
                    },
                    failure: function (response) {
                        alert(response.responseText);
                    }
                });
            },
            minLength: 1,
            select: function (e, i) {
                alert('AQUI');
                $("(id$=hfCustomerId)").val(i.item.val);
                $("(id$=txtProcurar)").val(item.label);
            }
        });
    });
</script>

Agora o .vb:

    (WebMethod)
    public static string() GetClientes(string prefixo)
    {
        List<string> clientes = new List<string>();

        clientes.Add(string.Format("{0}-{1}", "ContactName1", 1));
        clientes.Add(string.Format("{0}-{1}", "ContactName2", 2));
        clientes.Add(string.Format("{0}-{1}", "ContactName3", 3));
        clientes.Add(string.Format("{0}-{1}", "ContactName4", 4));
        clientes.Add(string.Format("{0}-{1}", "ContactName5", 5));

        return clientes.ToArray();
    }

javascript – Inserir texto em cor no campo de pesquisa através de autocomplete quando a palavra for iniciada com um asterisco ou por uma letra escolhida?

$('#search').on('input', function(event) {
  $('#hello').show();    
  if(!event.target.value.trim() || event.originalEvent.charCode === 42 || event.target.value.startsWith("*")) {
    $('#hello').hide();
    $(this).css({color: 'green'});
  } else {
    $('#hello').show();  
    $(this).css({color: ''});
  }
});
#hello {
  display:none;
}
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {

  -webkit-text-fill-color: green;

}
<input id="search" autocomplete="on"/>
<div id="hello" >Hello World!</div>

javascript – Preencher 2 ou mais campos de input (autocomplete) com o resultado de um JSON

Boa Noite pessoal

O caso é o seguinte

eu tenho um script PHP que me cria um Json com nome da pessoa e sua id

Json criado

(
  {
    "Nome_Pessoa": "Vinicius Domaia",
    "ID_Pessoa": "5"
  }
)

Arquivo BuscaPessoa.php

$PalavraPraBusca = $_REQUEST('query');

$SQL_Busca = "
SELECT SQL_CACHE Nome_Pessoa, ID_Pessoa
FROM pessoas 
WHERE Nome_Pessoa
LIKE '%$PalavraPraBusca%' 
";


$Busca = $ConnectionSystem->query($SQL_Busca) or die($ConnectionSystem->error);
$DadosAutoComplete = array();

if ($Busca->num_rows > 0) {
    while($Dados = $Busca->fetch_assoc()) {
        $DadosAutoComplete()= $Dados;

    }
    echo json_encode($DadosAutoComplete,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}

$ConnectionSystem->close();

O problema é aqui

<!DOCTYPE html>
<html>
<head>
    <title>Autocomplete</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
</head>
<body>
<br /><br />
<div class="container" style="width:600px;">
    <label>Pessoa</label>
    <input type="text" name="Pessoa" id="Campo_Pesquisa" class="form-control input-lg" autocomplete="off" placeholder="Digite o nome da pessoa" />
    <label>Id</label>
    <input type="text" name="Id" id="Id_Pessoa" class="form-control input-lg" autocomplete="off" placeholder="Id da pessoa" />

</div>

<script>
    $(document).ready(function(){
        $('#Campo_Pesquisa').typeahead({
            source: function(query, result){
                $.ajax({
                    url:"BuscaPessoa.php",
                    method:"POST",
                    data:{query:query},
                    dataType:"json",
                    success:function(data){
                        result($.map(data, function(item){
                            return item;
                        }));
                    }
                })


            }
        });

    });


</script>
</body>
</html>

Pois eu desejo que ao selecionar o nome da pessoa ele preencha o campo pessoa e o de id.

No momento só estou conseguindo colocar o nome mas a id não.

Alguém ai pode ajudar por favor?

forms – Ideal way to show autocomplete OR add new value option?

enter image description here

I have a field called “Creditor” in my form. The common users of my application are technologically un-savvy employees. The user can either search for an existing creditor to select using an autocomplete field, or they can “Add Creditor” which will show a popup modal where they input name, address, etc.

The attached image shows what I have so far, but I have certain doubts:

  • Does my use of the word “OR” properly demonstrate that clicking “Add Creditor” is not part of searching for creditor? I want to make sure that the user does not search for the creditor and then click on the button thinking this will “add” the creditor they just searched for. It should be clear that the autocomplete field and the button are diverging workflow steps.
  • Is the use of the magnifying glass icon confusing? It is commonly used to indicate a search box, but can this be used for autocomplete fields? Would it be more confusing to have no icon at all and just keep the placeholder text?
  • I would like to save some real-estate, but also keep the button in the same line as the field. Is the “OR” text necessary? Is there a more space-saving way to accomplish this? Is “Add Creditor” the best label for the button, or is “New”, “Add”, or just the plus icon sufficient?

Personalized form input box Sharepoint Sharepoint list autocomplete

I have a Sharepoint list named ListName, I am the site administrator, so I have all the permissions. I have created a web content editor with my own html file inside, the code is below. I want when I type a name, it searches the column of the list of share points "SuggestedName" and displays all the recommendations using Jquery autocomplete, no boxes are currently displayed and it’s boring to put a letter to write.

The errors are as follows: – Cannot read properties "find" – Maximum size of the call stack reached

But I am not sure that it is really relative.

   
$(document).ready(function() {
document.getElementById('poo').title = 'Test';
$().SPServices.SPAutocomplete({
    sourceList: "ListName", //The name of your List
    sourceColumn: "SuggestedName", //The name of the column you are taking the data FROM
    columnName: "Test", // The name of the column/textbox you want to apply the Autocomplete TO
    ignoreCase: true,
    numChars: 3,
    slideDownSpeed: 50,
    debug: true
});

});

 

Is a tree view or autocomplete a better user experience for the scenario below?

I'm creating a web app (web app only, no mobile functionality) and wondering if I should use a tree selection (where the user explores hierarchical categories until ; it finds its selection) or a semi-automatic entry (where the desired result is entered in and is filtered according to what has been typed, then the result can be selected. More precisely Material Angular are the versions of each that i & The links for the description and functionality of each are below

Tree

https://material.angular.io/components/tree/overview#nested-tree

https://stackblitz.com/angular/eaalmyagbxpn?file=src%2Fapp%2Ftree-nested-overview-example.ts

Autofill

https://material.angular.io/components/autocomplete/overview#adding-a-custom-filter

https://stackblitz.com/angular/yoqybbxoegl?file=src%2Fapp%2Fautocomplete-filter-example.ts

The specifics of this widget are as follows:

The user can only choose one option.

Each individual user will create these options for their own account. So the selectable options that user 1 sees will be completely different from the ones that user 2 can see, as each user will create them specifically for their own needs.

I am confident that the number of options that each user will create will be no less than 5 and no more than 50 the overwhelming majority of the time (there will be no restrictions put in place anyway, but it would be rare for someone to go above or below these figures).

They will probably use this function between 5 and 25 times a day

Let me know what everyone thinks. Would a tree selection be a better UX experience or a autocomplete better?

Search Engine Indexing – How To Avoid The Same Page From Loading AutoComplete Results Due To SEO Problems

Google doesn't want to index anything on your site that looks like search results. See Matt Cutts: Search Results in Search Results. You must use a mechanism to prevent Google from indexing the results of a search. As such, this JavaScript implementation is fine. Googlebot will not be able to explore the search results, and this is what is desired.

If you have content on full pages, you need to place that content at its own URL and link to that URL. But Googlebot doesn't need or want to see the results of an online search like the ones available in the demo you linked to.

interaction design – Ideas for showing autocomplete suggestions and validation messages in a clean way

I am currently working on a mission for a company to which I am applying. I need a text entry with a submit button that displays suggestions as types of users, but it should also display validation messages based on what the user types. I am looking for suggestions on a clear way to show this.

Here is my current layout:

enter description of image here

If this is not clear, the text box is on the left with the suggestions below, the Submit button is in the middle and the validation message is on the right. I could put the validation message under the suggestions, but it might seem a bit cluttered. Any other suggestions? It's not terrible like that but it seems a little annoying to me. Thank you!

magento2 – Add autocomplete = "on" to the e-mail field during payment

For some reason, we need to add the tag
autocomplete="off"
in the e-mail field at the checkout (/ checkout /).

So the current code:


Must become:


Now I'm looking for the file (.phtml?) Where I can change that … But I can't find it … Any idea which file to modify?
Thank you!