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
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
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.
Nice tip.. thanks for that!