我尝试在提交表单后,在网址中插入/连接,来自搜索查询的q和/或fq。这是我到目前为止尝试的代码:
& {$InstallationPath\$ApplicationId\$ApplicationId.exe install}
或
<input type="hidden" name="q" value="{{ content.params.q }}'{% verbatim %}&type={% endverbatim %}'{{request.GET.type}}" />
我也试过
<input type="hidden" name="q" value="{{ content.params.q }}&type{{request.GET.type}}" />
无济于事。基本上我想要最终的网址(即提交表单后地址栏中的内容)就像是
{% autoescape on %}
相反,我得到了
q=something&somethingelse
如何让模板输出&符号,而不是编码成%?
答案 0 :(得分:0)
实际上我使用了javascript。
<form role = "form" id="filter" action="/search/" method="get">
<input type="text" name="something" id="something" ...>
[...]
$(document).ready(function() {
$("#filter").submit(function(event) {
event.preventDefault();
$this = $(this);
var something = $('#something').val();
var qstr = window.location.search;
var url = qstr + '&something=' + something;
};
window.location.search = url;
});
});