【问题标题】:Search box sends input to a iframe url on a new page搜索框将输入发送到新页面上的 iframe url
【发布时间】:2011-09-12 01:44:42
【问题描述】:

我想要一个搜索框,其中一个人输入一个数字,表单会打开一个新页面,其中有一个 iframe,iframe 的 url 是http://othersite.com/results.php?id=numbersinputfromsearchbox

这可能吗?如果可以帮助您回答我,我正在将 wordpress 与 php/mysql/apache/linux 一起使用。谢谢!!

【问题讨论】:

标签: php wordpress iframe


【解决方案1】:
<form action="http://othersite.com/results.php?id=numbersblahblah" method="post" target="_blank">
    <!-- form fields here -->
    <input type="submit" value="Search" />
</form>

【讨论】:

  • iframe 将在我自己网站的不同页面上。
  • 据我所知,您可以在同一页面上发布到 iframe,但不能在其他页面上发布。要破解它,您可以使用表单的$(this).serialize();", append that to the action` 在帖子上序列化表单,然后在另一端反序列化并创建一个 iframe 元素,然后将其附加到正文......但它确实非常,很乱。您确定没有其他更清洁的解决方案吗? :)
猜你喜欢
  • 2019-11-24
  • 2015-08-23
  • 1970-01-01
  • 2015-11-13
  • 1970-01-01
  • 1970-01-01
  • 2016-06-28
  • 1970-01-01
  • 2012-09-25
相关资源
最近更新 更多