user2387572
user2387572

Reputation: 31

Need form to open in new window, possibly via javascript

I'm trying to get my form to open up in a new window when the Search button is clicked, but the target="_blank" function is not working. I'm borrowing code from another institution's form, and I'm wondering if the javascript is forcing each submission to open in the same window (I'm not familiar enough with javascript to know for sure).

The search that I need to open in a new window is from the "Books & More" tab of the following website: http://library.utb.edu/search/search2. This is the code that I'm using for that form:

<form target="_blank" name="searchform" onSubmit="return dosearch();" action="http://lib3.utpa.edu/search~S2/X" method="post" class="unpadded">

<input name="searcharg" value="" type="text" id="SEARCH" class="big-search-text" placeholder="Example: Of Mice and Men">

<input class="big-search-submit" name="cmdSubmit" type="submit" value="Search">

<input name="searchtype" type="radio" checked="" value="http://lib3.utpa.edu/search~S2/Y"> All Fields

<input name="searchtype" type="radio" value="http://lib3.utpa.edu/search~S2/t" target="_blank"> Title

<input name="searchtype" type="radio" value="http://lib3.utpa.edu/search~S2/a"> Author

<a href="http://lib3.utpa.edu/search/X" target="_blank">Advanced Search</a>
</form>

Any suggestions you could give would be greatly appreciated!

Upvotes: 0

Views: 142

Answers (1)

mambrowv
mambrowv

Reputation: 206

You can try putting your formtarget="_blank" in your submit input tag.

Example:

<input formtarget="_blank" class="big-search-submit" name="cmdSubmit" type="submit" value="Search">

Upvotes: 1

Related Questions