【问题标题】:How can i open Thickbox from a form and feed it with data?如何从表单中打开Thickbox 并为其提供数据?
【发布时间】:2010-04-04 17:26:17
【问题描述】:

我有一个简单的搜索 php 脚本,在该脚本中有一些 html 和 javascript 来制作搜索输入字段和一个按钮。 我想要做的是当有人输入搜索并按下提交时,thickbox 打开,结果将显示在thickbox 中。

到目前为止,我拥有的是搜索字段和按钮,当我按下提交时,它会短暂显示厚框,然后被结果页面超载,但没有搜索结果。

代码如下:

<form method="get">

<input type="text" name="merk"  size=10 style="font-weight: bold; background-color:#D5DF23;">&nbsp;&nbsp;

<input type="image" name="merk"  class="thickbox" onclick="document.location.href='searcher.php?keepThis=true&TB_iframe=true&height=520&width=800';"  src="zoek1.jpg" width="110" alt="Zoek" onMouseOver="this.src='zoek2.jpg'" onMouseOut="this.src='zoek1.jpg'">

</form></input>

【问题讨论】:

    标签: javascript html search thickbox


    【解决方案1】:

    您似乎缺乏对 HTML、JavaScript 以及一般编程的一些基本了解,您真的应该多花点时间了解基础知识。

    Thickbox 似乎不是为您想要的方式而设计的。无论如何,我查看了源代码,以更传统的方式使用该功能非常容易,使其更加灵活(只需使用适当的参数调用函数 tb_show )。你想要的是这样的:

    <input type="text" id="merk" size=10 style="font-weight: bold; background-color:#D5DF23;">
    <img onclick="tb_show('title','searcher.php?merk='+document.getElementById('merk').value+'&TB_iframe=true&height=520&width=800',false)" style="cursor:pointer;" src="zoek1.jpg" width="110" alt="Zoek" onMouseOver="this.src='zoek2.jpg'" onMouseOut="this.src='zoek1.jpg'">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-10
      • 2013-08-27
      • 1970-01-01
      相关资源
      最近更新 更多