views:

211

answers:

2

I have a simple search php script, within that script there is some html and javascript 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>

A: 

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'">
eBusiness
A: 

THANK YOU !!! it works like a charm, what i miss is the basic understanding of javascript, and my HTML could be named "sloppy". I learn a lot from this and am most gratefull.

i also changed a little piece to load the lightbox on the whole page instead of the iframe it was in. With this command.

self.parent.tb_show(.......

Mark Dekker