• 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter icravespam

    (@icravespam)

    bump anyone?

    Thread Starter icravespam

    (@icravespam)

    bump again

    Thread Starter icravespam

    (@icravespam)

    bump last time. no one knows?

    You tend to get ignored if you bump too much.

    Google “escape quotes php” to see what you’re doing wrong.

    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

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘search form onclick error’ is closed to new replies.