Support Forums

"search all" help part 2

This is a discussion on "search all" help part 2 within the Templates, HTML, CSS, and Design Help forums, part of the General category; Past thread was closed so i had to copy and paste the important parts here: From Someone: You can't change ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 07-06-2011, 05:08 PM   #1
Junior Member
 
Join Date: May 2011
Posts: 9
Rep Power: 0
codybrucewilliams is on a distinguished road
Default "search all" help part 2

Past thread was closed so i had to copy and paste the important parts here:


From Someone:

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);
}
});
});
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket

06-24-2011, 12:55 PM #5
Mike-N-Tosh +
Developer & Moderator



Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,271
Rep Power: 67


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



SO now, his help did indeed work for the first search boxes, but not the next ones as in this picture.

https://picasaweb.google.com/lh/phot...eat=directlink

Is there more code that i can add to change it to "SEARCH ALL" as indicated by the photo?


__________________
codybrucewilliams is offline   Reply With Quote
Old 07-06-2011, 05:44 PM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Is that a child extra field??? I believe that is actually called from the language file LANG_PLEASE_SELECT
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 07-06-2011, 06:15 PM   #3
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

You don't have to copy/paste, the solution was provided and I generally close threads so they don't lose focus. In this case just link to it: How to add "Search All" to extra fields

It should work for the child dropdown too, in my tests with a single parent/child both were rewritten. I don't have time to recreate the fields to retest it today, but if you can send a link I'd be glad to take a look.
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 07-06-2011, 07:05 PM   #4
Junior Member
 
Join Date: May 2011
Posts: 9
Rep Power: 0
codybrucewilliams is on a distinguished road
Default

I am sorry for posting it twice... and honestly i don't expect help, just more of a question and hopefully someone has time to answer, i don't mean to actually create work for anyone at all...

Yes i think i mistakenly for got to put in... the added code does in fact work for changing "search all" on parent category. the MODEL categories is a child category... i double checked when someone said that and it is true....

I do not want you guys to work at it, but if you know off the top of your head what i would have to change to change a child catargry to say "search all". If its hard or difficult, i could maybe find aa different method... Like maybe writhing at the top saying "Please select" means "Search All" or something like that.... will be back tonight to test.... thank you for your replies so far.
codybrucewilliams is offline   Reply With Quote
Old 07-06-2011, 10:52 PM   #5
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

Don't sweat it, if I have some time tomorrow I will setup the fields again and double check that it should do the child dropdown as well. I remember that it did for me, but its been some time.

Code:
$("#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);
            }
        });
    });
This bit should rewrite the child option text when ever the parent is changed. If that is not happening it might be that the javascript isn't able to find the element since it was also loaded via ajax. What browser (version too) are you using?
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 07-07-2011, 01:04 PM   #6
Junior Member
 
Join Date: May 2011
Posts: 9
Rep Power: 0
codybrucewilliams is on a distinguished road
Default

tested in Chrome 12 and IE 8 and firefox 5, all same
codybrucewilliams is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Search All" extra fields option brad33 Technical Support 5 04-30-2009 05:21 PM
Adding a "Product Directory" & "Find a Dealer" system spaceboy Technical Support 1 09-18-2008 06:16 PM
How to change title name "Place" to "post" on main page? YourPalAl Technical Support 4 04-28-2008 10:39 PM


All times are GMT -4. The time now is 09:44 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0