ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search Form Target

July 14, 2009 4:17pm

Subscribe [2]
  • #1 / Jul 14, 2009 4:17pm

    DRUMZ

    75 posts

    Quick question. I have a page with an iframe on it, and I’d like search results to display in the iframe. I tried a simple target=“iframename” in the search form tag, but the results reloaded in the same window instead of the iframe. There’s gotta be a simple way to do this but I can’t find it.

    Any help?

  • #2 / Jul 14, 2009 6:42pm

    DRUMZ

    75 posts

    Got it. The way I went around it was to give the form a name, and then right after the form is displayed, I changed the target of the form using < javascript>

    {exp:search:simple_form name="formname"}
    ...
    ...
    {/exp:search:simple_form}
    
    < script language="javascript" >
    document.formname.target = "iframename";
    < /script >
  • #3 / Nov 09, 2009 6:30am

    sajwal

    52 posts

    Thanks that helped a lot : Just to elaborate for a newbie like me 😉in case this helps :

    {exp:search:advanced_form name="mysearchform" weblog="yourweblogname" status="open|pending|closed" result_page="templategroupname/results" no_result_page="templategroupname/noresults" results="15" id="search_form"}<input type="text" name="keywords" size="25" maxlength="100" /> 
             <input name="submit" type="submit"  class="submit" value="submit" /> {/exp:search:advanced_form}
    
    
    <scr*pt type="text/javascript" charset="utf-8">
    document. mysearchform.target = "searchframe";
    </scr*pt>
    
    <iframe name="searchframe"/> /**You may style your iframe accordingly**/
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases