Forums

search form onclick error (6 posts)

  1. icravespam
    Member
    Posted 2 years ago #

    So I'm trying to enact this:

    http://www.namepros.com/code/70930-very-cool-javascript-function-alternative-onclick.html

    on my site's search bar: http://thespoke.t2j.us/

    problem is, general-template.php doesn't like: onclick="this.value=''"

    So when I put it in like so:

    <input type="text" onclick="this.value=''" value="SEARCH THIS SITE...' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />

    I get the following error:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/lonick/public_html/clients/thespoke/wp-includes/general-template.php on line 126

    So what's going on here? and how would I incorporate the javascript needed from the first link.

    thanks

  2. icravespam
    Member
    Posted 2 years ago #

    bump anyone?

  3. icravespam
    Member
    Posted 2 years ago #

    bump again

  4. icravespam
    Member
    Posted 2 years ago #

    bump last time. no one knows?

  5. songdogtech
    Member
    Posted 2 years ago #

    You tend to get ignored if you bump too much.

    Google "escape quotes php" to see what you're doing wrong.

  6. repulsion
    Member
    Posted 1 year ago #

    Not sure icravespam if you'll see this but I'm curious to know if you ever resolved this. I'm having the same problem:

    <form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >
    <div class="searchform-blog">
    <input type="text" name="s" id="s" placeholder="search" value="search blog" value="' . esc_attr(apply_filters('the_search_query', get_search_query())) . '" />
    <input type="image" src="/inc/img/icons/house-search.gif" class="search-button-blog" value="'. esc_attr__('Search') .'" />
    </div>
    </form>

    onclick="this.value=''" messes up my code

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.