I've added a search form to my site, but I want it to open a new window when you hit the "go" button. I tried just adding target="_blank" to the code, but it dinnae work. Why dinnae it work? ;_;
Printable View
I've added a search form to my site, but I want it to open a new window when you hit the "go" button. I tried just adding target="_blank" to the code, but it dinnae work. Why dinnae it work? ;_;
I think target="_blank" only works in anchor tags, and not in form submit buttons, as far as I know :p
Obviously, otherwise it would have worked when I did it.
That's two threads in a row you didn't immediatly solve my problem. You're losing your touch!
Use JavaScript to open a new window onClick:
http://www.pageresource.com/jscript/jwinopen.htm
Munty didn't solve the problem?
My world is crumbling around me...
Alright, maybe I'm just too tired but, Raf, what do I change this button code to to make the java opening crap work?
<*input type="image" border="0" value="Go" name="Submit" src="ap-search-go-btn.gif"align="absmiddle" width="21" height="21" />
<*input type="image" border="0" value="Go" name="Submit" src="ap-search-go-btn.gif" align="absmiddle" width="21" height="21" onClick="window.open('yourpage.html','mywindow','width=width,height=height')" />
yourpage is the filename of the page you want to open in the new window.
width and height are the, well, desired width and height of the javascript-generated window :p
I wouldn't pay attention to the "mywindow" part. It's the name of the window, and it's probably not a big deal for what you're using it for. You can change it to whatever you want.
That's the thing. I don't know what to put for your page. Its an Amazon.com search field, so I'm not opening a particular page, its submitting a search.
So the <*form action="something that's hosted on Amazon" />, and you want the search results to open in a new window? I'm not sure if you can do that, because the search results page is actually the script in the action property of the FORM tag. You may have to mess with the FORM and not the INPUT tag. You could try substituting yourname with the name of the script (it's linked to in < FORM action="script" ). That probably made next to no sense.
Try posting the code from < form> to form> so we can look through it. I think whether the results are opened in a new window is controlled within the actual script. Hopefully I'm just missing something really simple and obvious. Sorry I couldn't be of more help.
Here's what Amazon gave me:
http://www.questw0rld.com/code.txt
I looked at your site since that bit of code is unhelpful :p
Try changing <*form action="http://www.amazon.com/exec/obidos/external-search"> into <*form action="http://www.amazon.com/exec/obidos/external-search" target="_blank">
That's what I was going to suggest, but I figured the target property wasn't (and probably isn't) applicable to the FORM tag.
I too had a look at the frame source, and nothing helped. I looked around Amazon for a section about their site searches, but I couldn't find anything. Maybe there's a hidden input type that controls whether the form opens in a new window?
You can use target in a form tag. Example:
<form action="usercp.php?" target="_new">
<input type="submit" value="Open the User CP in a new window">
</form>
Wonderful.
I suppose I could have just tested it instead of wondering :p .
RAF WINS! *does a dance*