Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bas Wensveen 54 posts 75 karma points
    Apr 11, 2010 @ 13:08
    Bas Wensveen
    0

    XSLTSearch

    Hi all,

     

    I installed the XSLTSearch package and it works great. There is only one thing I like to know.

    Is it possible to display the search results on a diffent page?  

     

    The input textfield and search button are place in a masterpage. When the search criteria is entered and the search button is click I want to redirect the user to the search result page that is showing him the result.

     

    Kind regards,

     

    Bas

     

     

     

  • Rich Green 2246 posts 4008 karma points
    Apr 11, 2010 @ 13:18
    Rich Green
    0

    Yes.

    XSLT search uses a http get or post request to get the search field value, I prefer 'get' as it means searches can be bookmarked.

    <form method="get" action="/search.aspx?">

    <input name="search" type="text"/>

    <input type="button" value="Search" onclick="form.submit()" />

    </form>

    Rich

  • Kim Andersen 1447 posts 2196 karma points MVP
    Apr 11, 2010 @ 13:28
    Kim Andersen
    0

    Hi Bas

    Yes you can :)

    First of all you need to create a form on your master-template (Or on the pages where you want the searchform to be). This form has to have an action="/search.aspx". <--The action should point to the resultpage. In this case the resultpage would be on /search.aspx.

    In the form you need an input textfield and a submit-button. When the user clicks the search-button, the form takes he user to /search.aspx, where the result will be shown.

    You need to be aware that the input textfield has the correct name. Otherwise the XSLT-search doesn't know where to get the searchstring from. I can't remember the name, but I'm cuite sure that it sould look something like this:

    <input type="text" name="search" />

    I hope this makes sense.

    /Kim A

  • Bas Wensveen 54 posts 75 karma points
    Apr 11, 2010 @ 13:30
    Bas Wensveen
    0

    Hi Rich,

     

    Somehow the user in not redirected to the search.aspx page. My site contains serveral pages all with the same master page. The masterpage contains the search textbox an buttom. 

    After clicking search, I see that the page is submitted (page refresh) but the visitor is nog redirected to the search.aspx.

     

     

    Kind regards

     

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Apr 11, 2010 @ 13:35
    Kim Andersen
    0

    Bas, It sounds like you have another form outside the search-form. Is this the case? You need to have the search-form outside any other form, otherwise it could cause so problems.

    And instead of having a:

    <input type="button" value="Search" onclick="form.submit()" />

    You could use a submit-button like this:

    <input type="submit" value="Search" />

    This will also make sure that user who have disabled javascript, can use the form :)

    /Kim A

  • Bas Wensveen 54 posts 75 karma points
    Apr 11, 2010 @ 14:35
    Bas Wensveen
    0

    Kim,

     

    You were right, I had another form in my webpage :-). This solved the issue described above.

     

     

    Thank's!

     

    Bas

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft