我使用隐藏的输入类型来隐藏URL中的数据。这里是我的代码获取值表单输入类型隐藏
<input type="hidden" name="post_type" value="kcc-product">
<input type="hidden" name="post_type" value="kcc-manufacturer">
当我使用它,我收到网址为&post_type=kcc-product&post_type=kcc-manufacturer
但我需要它像:&post_type=kcc-product&kcc-manufacturer
只是我必须从URL中移除**post_type=**
。我试过
<input type="hidden" name="post_type" value="kcc-product">
<input type="hidden" name="" value="kcc-manufacturer">
但是,它不工作。我如何从URL中删除**post_type=**
?有任何想法吗?
你可以住'post_type = kcc-product,kcc-manufacturer'吗?你应该花一点时间看看@表单提交是如何工作的以及如何格式化URL查询字符串。你也可以做一些事情,比如'kcc-product =&kcc-manufacturer ='。 –
使用POST !!!!!!! –
要得到一个像你这样的URL,你需要一个名为'kcc-manufacturer'的表单域(隐藏或不隐藏),没有任何价值。这可能不是你想要的。所以,我建议重新评估你需要什么以及如何在服务器上使用提交的值。你可以使用jQuery来“组装”URL,但是,如果你期待这个值,你必须在服务器上做错了什么。 – Floremin