333 posts
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Became a Top 20 Author of the Month
+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
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Became a Top 20 Author of the Month
+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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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
  • Has been part of the Envato Community for over 6 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+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
  • Has referred 1+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Became a Top 20 Author of the Month
+8 more
CadenGrant
says

Oh haha my bad – thanks :)

1383 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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