jquery-ui-autocomplete 相关问题

来自jQuery-ui的自动完成小部件,使用户能够在键入时快速查找和选择预先填充的值列表,从而利用搜索和过滤。

jQuery autocomplete但反应和shadcn?

我已经搜索了我所知道的一切和任何地方。.您是否有任何图书馆: 使用shadcn 是反应 可以搜索 可以保存多个项目(逗号分隔之类的东西) 使用获取或其他...

回答 1 投票 0

将值设置为 jquery 自动完成组合框

我正在使用 jquery 自动完成组合框 一切都很好。但我也想通过 JavaScript 设置特定值,例如 $("#value").val("somevalue") 并将其设置为选择元素,但没有更改...

回答 6 投票 0

向 jquery 自动完成文本字段添加下拉箭头

我有一个包含 2 个字段的表单 - 供应商和 pav。供应商当前是一个自动完成文本字段,一旦选择供应商,它就会使用相应的值填充 pav 字段。我想要什么...

回答 1 投票 0

需要以特定方式对 PHP 数组进行 json_encode

好吧,我有一个 PHP 数组,如下所示: 大批 ( [0] => 数组 ( [标签] => 1 [值] => 值示例 ) [1] => 数组 ...

回答 1 投票 0

如何使用 JavaScript 或 jQuery 使用 Enter 键选择锚标记

我一直试图使用键盘箭头键并按 Enter 键在无序列表中选择锚标记。箭头键将突出显示链接,触发本机浏览器

回答 1 投票 0

jQuery 使用自动完成功能限制文本框输入

我正在使用 jQuery UI 的自动完成功能来尝试传播包含超过 1000 个值的表单的正确输入。 自动完成工作正常,但如何将字段的值限制为那些 v...

回答 1 投票 0

如何使用具有远程数据源的 jQuery UI 自动完成插件来区分显示值和 id 值?

我的应用程序中有一个搜索框,它使用 jQuery UI 自动完成插件从远程数据源根据姓氏显示系统中的用户列表。 当用户点击...

回答 1 投票 0

将 2 个以上变量传递到 JQUERY 自动完成

使用 JQUERY 自动完成功能,似乎只有“id”和“value”是它接受的唯一变量。还有什么可以传递更多给它吗?我正在尝试从城市表中传递我的 stateid 。这是我的

回答 2 投票 0

jQuery 自动完成显示 ID 而不是名称

所以我有这个 jQuery 脚本,它从数据库中获取内容,它需要显示产品名称(我的表有productid和productname)。但它没有显示产品名称,而是显示...

回答 1 投票 0

jQuery UI 使用外部 JSON 文件自动完成文本框中的多个值

我有兴趣实现此处找到的解决方案(jQuery UI Autocomplete Multiple Values in Textbox),但使用外部 JSON 文件而不是硬编码数据集。有人可以帮忙吗?

回答 1 投票 0

jQuery 在 Modal 上自动完成

当我单击#add 时,Bootstrap Modal 将打开。我想在模态中的输入框中显示自动完成功能。我的代码如下所示。 $('#add').on('点击', function () { var 选择器 = $('#addM...

回答 1 投票 0

Jquery-UI 自动完成设置所选文本为 0

我有一个表格,其中包含一行文本框 - 类别、制造商和型号。 当用户在模型字段中输入值时,我想显示一个自动完成框,显示与 wha 类似的匹配项...

回答 1 投票 0

自动完成功能,通过ajax回调结果循环遍历搜索词

我正在设置一个自动完成表单,其中我需要匹配每个关键字/术语。 我正在使用 ajax 回调来获取结果列表,并且尝试了许多解决方法将 json 结果转换为

回答 1 投票 0

jQuery 自动完成(ajax)在 SPA 中不起作用[重复]

这很好用: $("#Term").autocomplete({ 来源:'/ws/words.json?lang=en' }); 这很好用: $("#Term").autocomplete({ source: '/ws/words.json?lang=en' }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.14.0/jquery-ui.min.js"></script> <link href="https://code.jquery.com/ui/1.14.0/themes/base/jquery-ui.css" /> <link href="https://code.jquery.com/ui/1.14.0/themes/redmond/jquery-ui.css" /> <div id="myform"> <label for="Term">Term: </label> <input id="Term"> </div> 但是,当我删除 <div> 的内容并稍后使用从服务器传送的内容(包括 <input id="Term">)(如在单页应用程序中)填充它时,自动完成功能将停止工作,即使我将自动完成脚本与新的 <div> 内容。是什么原因造成的?我能做什么? 如果您希望删除元素内的 HTML,您可以这样做,但是您需要附加到容器而不是元素。但是,您需要将元素添加回 IN,而您在示例中没有这样做。 在这里,我在一个可能有点丑陋的庄园里做这一切。 考虑只隐藏元素而不覆盖容器文本。 你问的问题: const words = ["Hi", "By", "bye", "winter", "summer", "fall", "spring", "football", "boy", "friends"]; const template = document.getElementById("cool-auto-things"); const $myform = $("#myform"); $myform.on('add-autothings', function(event) { const $container = $(this); $container.textContent = ""; const $termContainer = $container.find('.term-container'); const templateClone = template.content.cloneNode(true); const container = document.getElementById("myform"); const $terms = $(templateClone).find(".term"); container.appendChild(templateClone); $terms.autocomplete({ // source: '/ws/words.json?lang=en' source: words }).on("autocompleteclose", function(event, ui) { const autodata = [{ termValue: $(this).val() }]; $container.trigger('got-completed', autodata); }); }).on('got-completed', function(event, myData) { const $container = $(this); $container.text($container.find('.term').val()); }).trigger('add-autothings'); .page-container { display: grid; place-items: center; margin: 1em; } .my-form { margin: 1em; padding: 1em; background-color: #00ff0022; } <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.14.0/themes/base/jquery-ui.min.css" integrity="sha512-F8mgNaoH6SSws+tuDTveIu+hx6JkVcuLqTQ/S/KJaHJjGc8eUxIrBawMnasq2FDlfo7FYsD8buQXVwD+0upbcA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.14.0/jquery-ui.min.js" integrity="sha512-MlEyuwT6VkRXExjj8CdBKNgd+e2H+aYZOCUaCrt9KRk6MlZDOs91V1yK22rwm8aCIsb5Ec1euL8f0g58RKT/Pg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <div class="page-container"> <div id="myform" class="my-form"></div> </div> <template id="cool-auto-things"> <label class="term-container">Term: <input class="term" /></label> </template> 隐藏而不是删除它/用文本替换 - 你真正想问的感觉就像: const words = ["Hi", "By", "bye", "winter", "summer", "fall", "spring", "football", "boy", "friends"]; const template = document.getElementById("cool-auto-things"); const templateClone = template.content.cloneNode(true); const container = document.getElementById("myform"); const $myform = $("#myform"); const $terms = $(templateClone).find(".term"); container.appendChild(templateClone); $terms.autocomplete({ // source: '/ws/words.json?lang=en' source: words }).on("autocompleteclose", function(event, ui) { const autodata = [{ termValue: $(this).val() }]; $(this).closest('.my-form').trigger('got-completed', autodata); }).focus(); $(".start-over").on("click", function(event) { $myform.trigger('add-autothings'); }); $myform.on('add-autothings', function(event) { const $container = $(this); const $termContainer = $container.find('.term-container'); $container.find('.term-text').hide(); const $term = $termContainer.find(".term"); $term.val(""); $termContainer.show(); $term.focus(); }).on('got-completed', function(event, myData) { const $container = $(this); const $termContainer = $container.find('.term-container'); $termContainer.hide(); $(this).find('.term-text').text(myData.termValue).show(); }); .page-container { display: grid; place-items: center; margin: 1em; } .my-form { margin: 1em; padding: 1em; background-color: #00ff0022; } <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.14.0/themes/base/jquery-ui.min.css" integrity="sha512-F8mgNaoH6SSws+tuDTveIu+hx6JkVcuLqTQ/S/KJaHJjGc8eUxIrBawMnasq2FDlfo7FYsD8buQXVwD+0upbcA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.14.0/jquery-ui.min.js" integrity="sha512-MlEyuwT6VkRXExjj8CdBKNgd+e2H+aYZOCUaCrt9KRk6MlZDOs91V1yK22rwm8aCIsb5Ec1euL8f0g58RKT/Pg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <div class="page-container"> <div id="myform" class="my-form"></div> <button type="button" class="start-over" data-target="#myform">Start Over</button> </div> <template id="cool-auto-things"> <label class="term-container">Term: <input class="term" /></label> <span class="term-text"></span> </template>

回答 1 投票 0

Jquery 自动完成:如何在页面加载时填写输入

我设置了一个jquery自动完成功能,它查询端点以获取输入中的选择(一旦您开始输入): $("#brand-select").autocomplete({ 来源:函数(请求,响应){ ...

回答 2 投票 0

具有多个输入的自动完成asp.net core

人! 我真的需要帮助,我正在尝试在 ASP.NET Core 中使用多个输入进行自动完成,但目前我只能返回一个值。当我输入这个人的名字时我可以绑定...

回答 1 投票 0

Symfony/bootstrap 中是否可以有一个自动完成文本框? [已关闭]

我正在使用 Symfony 2.4 和 Braincrafted Bootstrap 捆绑包。我一直在寻找一种在 Bootstrap 中具有自动完成文本框的方法,但看来我需要一个外部库来执行此操作(“

回答 1 投票 0

如何在 JQuery UI 自动完成中使用 source: function()... 和 AJAX

我需要一些有关 JQuery UI 自动完成的帮助。我希望我的文本字段 input.suggest-user 显示来自 AJAX 请求的名称。这就是我所拥有的: jQuery("input.suggest-user").autocomp...

回答 8 投票 0

如何在change事件上获取jQuery下拉值

我添加了两个 jQuery UI 下拉自动完成脚本。现在我想获取第二个下拉列表的更改值并希望单独存储在变量中。怎么可能呢? 有什么想法或建议吗?

回答 6 投票 0

jquery ui-autocomplete 不显示下拉列表

我们正在运行 tharuvi.com 在搜索框中,用户界面自动完成下拉菜单突然停止工作。服务器正在返回查询集,但 jquery 没有执行响应部分。 我的 html 表单: ...

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.