You are here:  » Search Form Enhancement

Support Forum



Search Form Enhancement

Submitted by crounauer on Tue, 2006-02-14 14:58 in

I have just made a little enhancement to the search form;

After doing a search, the search term remains in the search box, this is good, but if you want to do another search you first have to delete the text.

This enhancement will highlight all the text in the search box when you click on it, thereby enabling new text to be input straight away without having to delete the old text first.

This code is added to includes/searchform.php

onclick='this.focus();this.select()'

to look like...

size='35' onclick='this.focus();this.select()' value=

Hope someone find it useful :)

Simon

Submitted by support on Tue, 2006-02-14 15:02

Nice tip.. thanks for that!

Submitted by shogounou on Sun, 2009-05-17 13:33

Hi David

Can you just show me where I have to insert this mod, in the following code?

<form name='search' action='<?php print $config_baseHREF ?>search.php'><input class='inputfieldsearch' type='text' id='q' name='q' size='35' value='<?php print (isset($header["title"])?$header["title"]:""); ?>' />
<input type='image' src='<?php print $config_baseHREF ?>images/search.jpg' alt='Search' class='searchbutton' />
</form>

Thank you

Guillaume

Submitted by support on Sun, 2009-05-17 15:22

Hi Guillaume,

Have a go with...

<form name='search' action='<?php print $config_baseHREF ?>search.php'><input class='inputfieldsearch' type='text' id='q' name='q' size='35' onclick='this.focus();this.select()' value='<?php print (isset($header["title"])?$header["title"]:""); ?>' />
<input type='image' src='<?php print $config_baseHREF ?>images/search.jpg' alt='Search' class='searchbutton' />
</form>

Cheers,
David.

Submitted by Sabja on Tue, 2009-05-19 10:06

Thankyou for the tip. Works perfect :)