333 posts
  • Affiliate Level 1
  • Author Level 8
  • Collector Level 2
  • Top Monthly Author
+8 more
CadenGrant
says

I’m trying to insert a custom searchbar into the header but it’s not working. Everytime I hit enter it just like refreshes the page or something. Here’s the code im using:

<form method="get" action="<?php bloginfo('home'); ?>" role="search">
                <input class="searchinput" value="Search the site..." type="text" onfocus="if (this.value == 'Search the site...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search the site...';}" />
                <input class="searchsubmit" value="Search" type="submit" />
            </form>

Anybody know why its not working?

333 posts
  • Affiliate Level 1
  • Author Level 8
  • Collector Level 2
  • Top Monthly Author
+8 more
CadenGrant
says

Now somehow the search widget doesn’t even work =/ Just redirects to the homepage.. This ever happened to anybody?

1383 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+1 more
wpCanyonThemes
says

Now somehow the search widget doesn’t even work =/ Just redirects to the homepage.. This ever happened to anybody?

Where is the name of the input? :)

Should be “s”.

2468 posts
  • 6 Years of Membership
  • Author Level 2
  • Affiliate Level 4
  • Beta Tester
+3 more
digitalimpact
says

The input text field should be named “s”

So:


<form method="get" role="search" action="<?php bloginfo('home'); ?>">
                <input name="s" class="searchinput" type="text" value="Search the site..." onfocus="if (this.value == 'Search the site...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search the site...';}" />
                <input class="searchsubmit" type="submit" value="Search" />
            </form>


EDIT : Boba’s too fast :P

333 posts
  • Affiliate Level 1
  • Author Level 8
  • Collector Level 2
  • Top Monthly Author
+8 more
CadenGrant
says

Oh haha my bad – thanks :)

1383 posts
  • 6 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+1 more
wpCanyonThemes
says

@digitalimpact – Haha :)

@CadenGrant – Welcome, it’s usually simple probs like that that take the most time to figure out :) Additional set of eyes helps a lot.

by
by
by
by
by
by