用另一种形式过滤搜索结果
所以问题是
我有一个表单,它在提交后输出搜索结果,并带有这个 URL
http://localhost/thi/search/results?keyword=barma&search=1&minprice=nomin&maxprice=nomax&minroom=nomin&maxroom=nomax&minyear=nomin&maxyear=2010
现在我有另一个表单,它应该通过获取搜索结果的当前 url 并将其附加到它来过滤前一个表单的结果获取此表单提交的变量。
我之前尝试过过滤,但那是使用锚链接。我应该如何用表格来做呢?安妮有什么办法吗?
so here's the problem
I have one form, it outputs search results after submit, with this URL
http://localhost/thi/search/results?keyword=barma&search=1&minprice=nomin&maxprice=nomax&minroom=nomin&maxroom=nomax&minyear=nomin&maxyear=2010
Now I have another form, which is supposed to filter the results from the previous form by getting the current url of the search results and appending to it the GET variables submitted by this form.
I tried filtering before, but that is with anchor links. How am I supposed to do it with forms? Anny approaches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需使用现有数据填充表单即可。如果它是可以更改的内容,则使用文本输入、选择或其他任何内容,并将默认值设置为 URL 中的任何内容。如果无法更改,请使用隐藏输入。
Just populate the form with the existing data. If it is something that can be changed, then use a text input, a select, or whatever and set the default value to whatever is in the URL. If it can't be changed, use a hidden input.