开发者

How can i open Thickbox from a form and feed it with data?

I have a simple search php script, within that script there is some html and javascri开发者_运维技巧pt to make a search input field and a button. What i am trying to do is when someone enters a search, and presses submit, thickbox opens, and the results will be displayed in the thickbox.

What i have so far is the search field and button, when i press submit, it briefly shows the thickbox, and than is overloaded by the result page, but than with no search results.

Here is the code:

<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>


It would seem that you lack some of the basic understanding of HTML, JavaScript and probably also programming in general, you really should spend some more time getting the basics down.

It would seem that Thickbox is not designed to be used the way you want to. In any case, I took a look at the source code, and it's pretty easy to use the functionality in a more conventional manner making it more flexible (just call the function tb_show with the appropriate parameters). What you want would be something like this:

<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'">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜