How do I modify search facility code to open in a new window?

Discussion in 'JavaScript' started by metamuse, Jul 1, 2007.

  1. #1
    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):

    <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>
    Code (markup):
    2. Add the following <form> to your page:

    <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>
    Code (markup):
    3. Add the following <frame> to your page:

    <frame id="SearchFrame" 
    src="http://www.powersourceonline.com/cgi/en/vstock.search">
    Code (markup):
    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.
     
    metamuse, Jul 1, 2007 IP