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![]()
Use JavaScript to open a new window onClick:
http://www.pageresource.com/jscript/jwinopen.htm
And then there is Death
<*input type="image" border="0" value="Go" name="Submit" src="ap-search-go-btn.gif" align="absmiddle" width="21" height="21" onClick="window.open('<i>yourpage</i>.html','mywindow','width=<i>width</i>,height=<i>height</i>')" />
<i>yourpage</i> is the filename of the page you want to open in the new window.
<i>width</i> and <i>height</i> are the, well, desired width and height of the javascript-generated window![]()
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.
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 <i>action</i> property of the <i>FORM</i> tag. You may have to mess with the <i>FORM</i> and not the <i>INPUT</i> tag. You could try substituting <i>yourname</i> with the name of the script (it's linked to in < FORM action="<i>script</i>" ). 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
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">
And then there is Death
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>
<form action="usercp.php?" target="_new">
<input type="submit" value="Open the User CP in a new window">
</form>
And then there is Death
Wonderful.
I suppose I could have just tested it instead of wondering.