vForums Support > Programming & Coding :: Code Requests & Support :: > Search Box

Search Box - Posted By -Sinister- (that1dude) on 25th Mar 08 at 11:20pm
Is there a code i can get that will let me put a search box for my forum?

Re: Search Box - Posted By Marc (cr0w) on 25th Mar 08 at 11:47pm
 
Is there a code i can get that will let me put a search box for my forum?


Sorry, could you be a bit more specific?

Re: Search Box - Posted By Graham (amusedtodeath) on 25th Mar 08 at 11:53pm
Do you mean in the same way that Slip and Wrighty's skin has one?

Re: Search Box - Posted By -Sinister- (that1dude) on 26th Mar 08 at 12:04am
 
Do you mean in the same way that Slip and Wrighty's skin has one?


Yea, but not that same look. I tried making one, but i cant get it to search. heres what it looks like

Clicky

I just want it to search my boards and stuff. Same feature as the one here kind of, but different look.

Re: Search Box - Posted By Pixel Drixel (gfxman) (gfxman) on 26th Mar 08 at 12:17am
I'm just wondering, can't you just press Ctrl+F?

Re: Search Box - Posted By Marc (cr0w) on 26th Mar 08 at 12:20am
 
I'm just wondering, can't you just press Ctrl+F?


That just searches for text on the current page. {Wink}

Re: Search Box - Posted By Pixel Drixel (gfxman) (gfxman) on 26th Mar 08 at 12:28am
Oh. My bad.

Re: Search Box - Posted By Marc (cr0w) on 26th Mar 08 at 3:30am
I'll get this to you after school if it's not been looked at by then. {Smile}

Re: Search Box - Posted By -Sinister- (that1dude) on 27th Mar 08 at 1:02am
Thanks Marc,

I dont think ill be back on until Friday though.

Re: Search Box - Posted By Michael (wrighty) on 29th Mar 08 at 5:01pm
Marc, are you still working on this?

Re: Search Box - Posted By Marc (cr0w) on 29th Mar 08 at 6:00pm
 
Marc, are you still working on this?


I was hoping to get my sexy project done today, but I'll hopefully be able to get to this after. {Smile} If you want to do it, that's also fine.

Re: Search Box - Posted By Michael (wrighty) on 31st Mar 08 at 12:00pm
I will simply post the one that I coded for the default vF skin. I have removed one or two things that aren't needed. I have made the parts that do the 'searching' red. If you have any questions, simply ask! {Smile}

<script>
function search(){
    if(get('search','id').value != ''){
        location.href = '/action/search/search_words/' + get('search','id').value;
    }else{
        get('search','id').value = '';
    }
}
</script>


<form action="javascript:void(0);" onsubmit="search();">
<input type="text" id="search">
<a onclick=search();>
Search!
</a>
</form>


As you can see, it's fairly simple to do. All that you have to make sure is that the form 'action' to 'javascript:void(0)' => so that it doesn't submit & also, make it submit to the search function. Also, make the link 'Search!' go to the same function.

Again, if you don't understand, let me know! {Smile}

Re: Search Box - Posted By -Sinister- (that1dude) on 1st Apr 08 at 11:25pm
Yea, sorry, i dont understand. When i put the code in, the serach button wont search. It has a link hover effect but when i click it its not taking me anywhere.

Re: Search Box - Posted By Michael (wrighty) on 1st Apr 08 at 11:26pm
a Forum Link? {Smile}