Page 1 of 1

Quicksearch submit button

Posted: Wed Feb 08, 2006 3:52 pm
by txgal
Is it possible to add a Go or Submit button to the default Quicksearch plugin? I know this is an option with the Google Plugin, but don't see the option with the default Quicksearch. It is something that I'd never even thought about, but we have received a couple of user comments about the "missing" button. Thanks!

Re: Quicksearch submit button

Posted: Wed Feb 08, 2006 4:19 pm
by garvinhicking
This would be possible, but at the current time I'm a bit short off time on that issue.

You can easily copy the HTML code of the quicksearch plugin and put it into a HTML nugget plugin, where you can add a submit button anyway you like...?

Regards,
Garvin

Posted: Wed Feb 08, 2006 10:04 pm
by judebert
I'm time-starved, too. But here's a couple of things you can try, to tide you over until someone can give it an in-depth look.

The QuickSearch plugin is in include/plugin_internal.inc.php. All these directions will apply to that file. Save a copy as plugin_internal.inc.php.orig before making any changes, so if we screw something up, you're not high and dry.

First try: edit the file, and somewhere around line 336 you should find the form with id="searchform". Remove the hidden input field called action, and add this input field just before the end of the div:

Code: Select all

<input type="submit" name="serendipity[action]" value="search"/>
I'm almost certain that'll get you the button you want. But maybe you'd like a different name. Or maybe I'm wrong, and it didn't work.

Second try: put the hidden field line back. Just before the end of the div, add this input field:

Code: Select all

<input type="submit" name="searchbutton" value="Go!"/>
If that works, and your blog is configured for the convenience of those who speak multiple languages (or, in fact, anything other than English), you can try this internationalized version:

Code: Select all

<?php echo '<input type="submit" name="searchbutton" value="'.GO.'"/>'; ?>
Good luck!