Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I modify search facility code to open in a 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):


    <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:


    <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:

    <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.

  • #2
    New Coder
    Join Date
    Apr 2007
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <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>

    just replace the first javascript code with this and it should work

  • #3
    New to the CF scene
    Join Date
    May 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    Thanks for your help so far - it's much appreciated. I uploaded a test page to try it out: http://www.pixeldom.co.uk/projects/l...es/search.html

    It does load a new page which is great (a big step forward) but the results don't appear in it and I get an 'unable to process request' message. Do you have any suggestions?

    Thanks again!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •