ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple search field populating with "undefined undefined"

January 21, 2011 6:09pm

Subscribe [3]
  • #1 / Jan 21, 2011 6:09pm

    julie p

    282 posts

    I have what I think is a very straightforward piece of code for a simple search on my site:

    <div id="search">
     {exp:search:simple_form weblog="articles" result_page="search/results" results="10" where="any" search_in="everywhere"}
        <input type="text" class="search-text" name="keywords" id="keywords" value="Search this website" /> 
        <input type="image" src="/images/btn-search.gif" class="search-submit" /> 
    {/exp:search:simple_form}
    </div>

    The form field, when displayed, only contains “undefined undefined” and the HTML rendered is this:

    <input type="text" class="search-text" name="keywords" id="keywords">

    The value is missing. I’ve tried removing the value attribute to no avail. Ideas? Thanks!

  • #2 / Jan 23, 2011 2:19pm

    Greg Salt

    3988 posts

    Hi Julie,

    Can you provide a little more detail please? What do you mean when you say you’ve tried removing the value attribute? Which version and build is this installation? Please list any addons you are using for this site and do you have a public page where we can see this issue?

    Cheers

    Greg

  • #3 / Jan 23, 2011 2:30pm

    julie p

    282 posts

    Sure thing:

    By “removing the value attribute”, I mean that I removed the ’ value=“Search this website” ’ from the <input> tag itself. I also tried ’ value=”” ‘. FWIW, the value was working just fine until I added the ee fields around it… And the search submits just fine.

    I’m using EE 1.6.9 Build 20100415

    I’ve PM’d you the site and can offer you credentials if you’d like. It is not exactly public yet 😊

    I’m using quite a few addons
    Playa (3.0.9)
    Wygwam(2.1.4)
    Tab Forward
    LG Add Sitename
    Rating (2.3.3)
    Tag(3.0.2)
    User(3.1.0)
    Category Checkboxes
    Low Seg2Cat
    FieldFrame
    Clone Entries
    jQuery is enabled
    Low NoSpam
    Edit Tab AJAX
    and a custom extension to add elements to the .htaccess file on entry publish

  • #4 / Jan 24, 2011 8:18am

    Sue Crocker

    26054 posts

    Hi, Julie.

    When I take your same code and plug it into its own template, the value attribute fills in correctly.

    This means that the code itself is sound, but there is something on your individual template that is causing the problem.

    About the best thing I can suggest you doing is to greatly reduce your template, and then add back in complexity until you figure out what broke it.

    NOTE: I tried this with EE1.7.0 with no third party add-ons.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases