如何仅显示具有匹配名称输入字段值的表单
How to show only those forms with a matching name input field value
我有一个页面,上面有很多表格。
Each form has a unique id.
Each form has a user name field.
的例子:
<form id="new_celebration692130342" accept-charset="UTF-8" action="/celebrations" method="post">
<input id="friend" type="hidden" name="celebration[friend_name]" value="Anthony Rosenfeld">
<input id="friend" type="hidden" name="celebration[friend_fbuid]" value="69213034***2">
<input id="friend" type="hidden" name="celebration[friend_birthday]" value="12/09">
<input id="friend" type="hidden" name="celebration[friend_pic]" value="http://graph.facebook.com/69213034***2/picture">
<li>Anthony Rosenfeld</li>
<li>12/09</li>
<input class="button-mini-subtle submit" type="submit" alt="select" value="select">
</form>
我想让用户能够输入一个名称或开始在搜索框中键入,javascript/jquery将运行,只显示与名称字段匹配的表单。
对于这类操作,我是一个主要的新手,如果有人指出正确的方向,我会很感激。
$(function () {
$("#searchBox").keypress(function () {
console.log($('input[name~="' + $(this).val() + '"]').parent('form'));
});
});
这将把所有具有与searchBox值匹配的名称的输入子元素记录到控制台
相关文章:
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 而循环只设置php中输入字段中的第一个值
- 在输入字段中将最小金额设置为
- 如何在输入字段中的按钮的帮助下打开日历,该字段的类型为“=”;日期”;
- 如何在HTML输入字段中添加不可删除的后缀
- 互斥单选按钮和相应的输入字段
- 在IE9中的输入字段中输入焦点最近按钮
- 选中单选框时将属性添加到输入字段
- 当设置addFromAutocompleteOnly时,剩余文本将保留在输入字段中
- 我如何在数字插入中使用逗号,这样它就不会'不要破坏我的输入字段
- 在输入字段上有两个函数调用,一个在Blur上,一个不在Angular中
- 输入字段将't获取更新的值
- 如何选择多个输入字段并删除所需的属性
- 输入字段,只接受0到12之间的数字
- 单击鼠标,用MySQL数据填充html表单输入字段
- 使用jquery将输入字段转换为文本
- Model中的Typeahead返回空值以形成输入字段
- 如何从查询字符串中的输入字段发回文本
- 如何验证日期、月份和日期的3个独立输入字段;年使用jquery或javascript
- 将值传递给jquery创建的输入字段