How to add "Search All" to extra fields

Discussion in 'Technical Support' started by codybrucewilliams, Jun 24, 2011.

Thread Status:
Not open for further replies.
  1. codybrucewilliams New Member

  2. seymourjames All Hands On Deck

    'Please select' is not the same as search all in terms of the action. Are you sure you wish to change this? If you do then I believe it is in the language file where most other labels are defined. If you don't want a 'search all' action then you will need to recode the search form in search.tpl to stop that.
  3. codybrucewilliams New Member

    yes, a "search all" would be very handy.

    For example:

    Someone didn't just want to find all Acuras under $3000 but ALL the models under $3000...

    If a person chooses NO model, then yet is searches all, but its not clear to the user they can leave it on "please select", i would love to change the words "Please Select" to "Select All" and thats it... just the words.

    Is it just something simple I may have overlooked?
  4. John Snyder Staff

    You can't change it via language without it changing outside of the search. However the extra fields for search are all done via ajax, so you could alter the javascript to rewrite it to anything you want:

    I've added this in two places see below:
    Code:
    msg = msg.replace(/Please Select/g, 'Search All');
    Code:
    $("#type").change(function()
        {
            $("#response").show();
            $("#optResponse").hide();
            //alert($('#type option:selected').val());
            $.ajax({
                url: 'ajax.php',
                data: 'action=extra_listing_fields&do=search§ion=' + $('#type option:selected').val(),
                type: 'post',
                success: function (msg) {
                    msg = msg.replace(/Please Select/g, 'Search All');
                    $("#response").html(msg);
                }
            });
        });
        $("#parent").change(function()
        {
            $("#response").show();
            //alert($('#section option:selected').val());
            $.ajax({
                url: 'ajax.php',
                data: 'action=extra_listing_fields§ion=' + $('#type option:selected').val(),
                type: 'post',
                success: function (msg) {
                    msg = msg.replace(/Please Select/g, 'Search All');
                    $("#response").html(msg);
                }
            });
        });
    
  5. Mike-N-Tosh Developer & Moderator

    Just to clarify John's excellent response, the javascript code that he is referring to is in the template file not the ajax file itself. search.tpl
  6. codybrucewilliams New Member

    i was just about to ask that! thanks
  7. John Snyder Staff

    Thanks Mike, the info was useless without knowing where to put it.
  8. seymourjames All Hands On Deck

    OK - you are talking about extrafields and not the category. The screen shot is clear.
Thread Status:
Not open for further replies.

Share This Page