Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Howto target=_blank ?
Old 06-24-2009, 04:18 PM Howto target=_blank ?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
I have this input search field but i want when someone types a query and presses enter the results should appear in a new window. What do i change?

Code:
<form name="searchfrm2_mod" method="post" action="javascript: var searchword = document.searchfrm2_mod.mt_search.value;if(searchword=='search..'){searchword='';}document.location.href= 'http://www.website.com/index.php/Search.html?searchword=' + searchword ">
<div class="search" align="left">
<input id="search" class="inputbox" type="text" onkeypress="if(event.keyCode == 13){var searchword = document.searchfrm2_search.value;if(searchword=='search..'){searchword='';}document.location.href= 'http://www.website.com/index.php/Search.html?searchword=' + searchword }" onfocus="if(this.value=='search..') this.value='';" onblur="if(this.value=='') this.value='search..';" value="search.." size="40"/>
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
 
Register now for full access!
Old 06-24-2009, 04:25 PM Re: Howto target=_blank ?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Just add target="_blank" to your <form> tag.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-24-2009, 04:30 PM Re: Howto target=_blank ?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
target="_blank" in the form tag does open a new window but the search results doesnt appear in that window it appears in the _self window
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
Old 06-24-2009, 06:01 PM Re: Howto target=_blank ?
ihsaan's Avatar
Extreme Talker

Posts: 155
Name: Ihsaan
Location: Botswana
Trades: 0
anyone else please?
__________________

Please login or register to view this content. Registration is FREE
ihsaan is offline
Reply With Quote
View Public Profile Visit ihsaan's homepage!
 
Old 06-25-2009, 11:06 AM Re: Howto target=_blank ?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Didn't see that you had javascript for the action attribute. Try this (not 100% sure if it will work, but you didn't provide the whole form):

HTML Code:
<form target="_blank" name="searchfrm2_mod" method="get" action="http://www.website.com/index.php/Search.html" onSubmit="if (document.getElementById('searchword').value == 'search..') {document.getElementById('searchword').value = '';}">
<div class="search" align="left">
<input type="text" name="searchword" id="searchword"/>
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-25-2009, 02:02 PM Re: Howto target=_blank ?
Junior Talker

Posts: 1
Trades: 0
try with target = _new
robinsonk03 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Howto target=_blank ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26877 seconds with 12 queries