help! need search facility code to open in new window

This is a discussion on "help! need search facility code to open in new window" within the JavaScript Forum section. This forum, and the thread "help! need search facility code to open in new window are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 15th, 2007, 15:01
New Member
Join Date: Jul 2007
Location: UK
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
help! need search facility code to open in new window

Hello,

I'm currently working on a website which needs to integrate some search facility code that the client has supplied to me. However, the code I've been given was designed to be intergrated into a site built using a frameset (which mine isn't) and I'd like to modify it so that instead of loading the results in a frameset, they open in a new window. Could someone please take a look at the instructions and code below and tell me if this is possible?

Thanks!


1. Add the following javascript to the <head> of your page (please call
your CSR to get your client no. in order to replace it in the javascript):


HTML: Select all
<script type="text/javascript">
function RefreshFrame( pFrameId ) {
document.target = pFrameId;
var wController = 
'http://www.powersourceonline.com/cgi/en/vstock.search/';
var wSearchString = document.getElementById( 'SearchBox' ).value;
var wClientNoString = "123456";
document.location = wController + wSearchString + '-' + 
wClientNoString + '-br';
}
</script>
2. Add the following <form> to your page:


HTML: Select all
<form method="post" id="Search" 
action="javascript:RefreshFrame('SearchFrame')">
<span>Part Number</span>
<input id="SearchBox" name="SearchRequest.QueryCriteria.SingleBox" 
size="30" type="text" value="" />
<input type="submit" value="Go" />
</form>
3. Add the following <frame> to your page:

HTML: Select all
<frame id="SearchFrame" src="http://www.powersourceonline.com/cgi/en/vstock.search">
Note:
You can implement the frameset to your liking but the frame containing the VStock Search results, should never be less than 760 pixels wide, it is the minimum.

On another forum someone suggested using the code below. It does launch a new window but the search results don't load in it...

HTML: Select all
<script type="text/javascript">
function RefreshFrame(unusedarguement) {
var wController =
'http://www.powersourceonline.com/cgi/en/vstock.search/';
var wSearchString = document.getElementById( 'SearchBox' ).value;
var wClientNoString = "123456";
var fullsearchurlstring = "";
document.location = wController + wSearchString + '-' + wClientNoString + '-br';
window.open(fullsearchurlstring,'SearchResponse');
}
</script>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Reply

Tags
javascript, new window, search facility

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open another new window from javascript window thehermitage JavaScript Forum 10 Jan 27th, 2008 19:42
Change open in new window to open in same window nsr500rossi JavaScript Forum 2 Jan 18th, 2008 14:13
[SOLVED] open new window from main window AdRock Other Programming Languages 1 Nov 1st, 2007 02:45
Open a new window pokerskatershark JavaScript Forum 4 Mar 17th, 2006 19:25
I would like to add a search facility on my website - any suggestions? constantinesavva Web Page Design 3 Feb 25th, 2006 23:34


All times are GMT. The time now is 12:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42