Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Add you blog search to the search


Sven Lehnert
Participant

@svenl77

Because I need it and I don’t want spend much time getting into it, I just use the static way. May be not the correct way to do it, but for me it’s working.

<script type=”text/javascript”>

function check_search_url() {

var form = document.getElementById(‘search-form’);

var which = document.getElementById(‘search-which’);

var terms = document.getElementById(‘search-terms’);

if( which.selectedIndex == 0 ) {

form.setAttribute(“action”,”http://yourdomain.com/?s=”+terms.value) ;

}

}

</script>

<form id=”search-form” method=”post” action=”http://yourdomain.com/search”&gt;

<input type=”text” value=”” name=”search-terms” id=”search-terms”/>

<select id=”search-which” name=”search-which”>

<option value=”blog”>Blog</option>

<option value=”blogs”>Blogs</option>

<option value=”members”>Mitglieder</option>

<option value=”groups”>Gruppen</option>

<option value=”forum”>Forum</option>

</select>

<input type=”submit” onclick=”check_search_url()” value=”Suche” id=”search-submit” name=”search-submit”/>

</form>

Skip to toolbar