I haven't found this in my search, but it is not something that is easily defined ...also I am not sure whether this is PHP or more Javascript, so my apologies if I have posted in the wrong place.
Anyway, I have this PHP form:
<?php
$app = $this->globals('khxc_display.app');
$eol = $this->globals('khxc.eol');
$formid = $app . '--minisearch';
$strid = $app . '--prodsearch--string';
$link = $this->link_namespace($app,'prodsearch',array());
$cgi_value = '';
$this->xhtml_quickform_header($formid,$app,'prodsearchp',array());
print '<p class="hidden"><label for="' . $app . '--minisearch--' . $strid . '"';
print '>Search Term</label></p>' . $eol;
print '<p class="inline"><input class="khxc_quickfield" type="text" name="' . $strid;
print '" id="' . $app . '--minisearch--' . $strid . '" value="';
print $cgi_value . '" size="26" maxlength="100" /></p>' . $eol;
$this->xhtml_quickform_footer($formid,'Quick Search by Item Name',1);
print '<a class="unfancy" href="' . $link . '" title="Advanced Search">Advanced Search</a>' . $eol;
?>
...and I am wanting to integrate the following Javascript script into it in order to prefill the search box and have it autoclear when someone clicks on it:
<form name="text_form" action="http://www.codeave.com/html/post.asp" method=post>
<input name=u_input onFocus=clear_textbox() value=" Enter Your Search Here ">
<input type=submit value=Submit>
<input type=reset>
</form>
I have already added the function part of the script...
<script language=JavaScript>
<!--
function clear_textbox()
{
if (document.text_form.u_input.value == " Enter Your Search Here ")
document.text_form.u_input.value = "";
}
-->
</script>
...to my scripts file, but I cannot get the integration of the Javascript side of things to work properly.
So can anyone show us all how to properly integrate the two? - The best I have been able to come up with so far is a broken search box with autofilled text that remains no matter what!! :icon_cheesygrin: