19
Jun
Jun
Having trouble with my site search input boxes
I want to be able to put a (value="SEARCH") in the input box but make it disapear when clicked. The problem is that the search code has a JS browser compatability code, so when I try to insert (onfocus="this.value=’ ‘") the input box does not display on my website. any ideas?
my code:
Code:
<SCRIPT language=Javascript>
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
// *** BROWSER VERSION ***
// note: on IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav = ((agt.indexOf(’mozilla’)!=-1) && (agt.indexOf(’spoofer’)==-1)
&& (agt.indexOf(’compatible’) == -1) && (agt.indexOf(’opera’)==-1)
&& (agt.indexOf(’webtv’)==-1));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));
var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
</SCRIPT>
<SCRIPT language=Javascript>
if (is_nav4) {
document.write(’<input type=text name=Search value="SEARCH" id="search_v5_1" size=7 maxlength=50>’);
} else if (is_nav5up) {
document.write(’<input type=text name=Search value="SEARCH" id="search_v5_2" size=12 maxlength=50>’);
} else {
document.write(’<input type=text name=Search value="SEARCH" id="search_v5_3" size=15 maxlength=50>’);
}
</SCRIPT>30,000 Mb And Unlimited Bandwidth Only $3.75/mo.
Powered By: BigInfo.org
Relevant Links

