Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Pop Up Window Prob..!

Status
Not open for further replies.

Tezdread

Technical User
Oct 23, 2000
468
GB
Hi all :) I'm still trying to get the hang of this.
I have recently signed up for free site search with atomz.com, and I am trying to customize the search results window. What I would like it to do is open a new window at a set size and without the address bar etc when I click the submit button, (i guess I will have to use the onclick) I have tried a few scripts (cut n paste n editing) but can't seem to get it right. I can't have the onclick refering to a particular page as it is random from the search (scratches head) I have been in contact with atomz and they were good enough to tell me it can be done, as they have seen it, but don't know where or how (so I come to ask the experts) I was hoping I could use the target="_blank" but because it is a submit button that doesnt work.

This is the form code
<form method=&quot;get&quot; action=&quot; <div align=&quot;center&quot;>
<input size=11 name=&quot;sp-q&quot;>
<br>
<input type=image value=&quot;Search&quot; name=&quot;submit&quot; src=&quot;images/sitesearch2.gif&quot; width=&quot;90&quot; height=&quot;23&quot; border=&quot;0&quot; alt=&quot;Site Search&quot;>
<input type=hidden name=&quot;sp-a&quot; value=&quot;000a204c-sp00000000&quot;>
</div>
</form>

I also tried putting this code into the search results template HTML
<!-- full screen
if (top.frames.length!=0)
top.location=self.document.location;

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
//-->
and this works but I can't resize it to my disired size or take out the address bar etc...

If anyone can help I will be able to sleep again :)
 
There is a somewhat complicated way of doing this. Change the form so that there is no action. Make the submit button into a normal button, and assign an onclick that opens a new window. Inside the new window is the same form you use normally, but the text field should be type hidden instead. In the onload handler of this new window, have it grab the original value they typed in (opener.document.formname.sp-q.value) and store it in the replacement hidden field. now call document.formname.submit() (still in the onload)... the search results will be in a new window. jared@aauser.com
 
Thanks jaredn, you're right about complicated :) but that's cool, if it was easy, I would have done it and so would everyone else, and I like to try and make things different from everybody else, :) I will play with it, but not sure I can take out the action? this is what they wanted me put in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top