Hi there,
I have a search engine which doesn’t seem to work. It gives me “about blank” instead of expected search results. When I remove [U]id=”customselector”
[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script type=”text/javascript” src=”../scripts/jquery-1.2.6.min.js”></script>
<script type=”text/javascript” src=”../scripts/jquery.customselect.js”></script>
<script type=”text/javascript”>
$(document).ready(function() {
$(‘#customselector’).customSelect();
})
</script>
<script type=”text/javascript”>
function startSearch(SEARCH){
searchString = document.getElementsByName(SEARCH)[0].searchText.value;
if(searchString != “”){
searchEngine = document.getElementsByName(SEARCH)[0].whichEngine.selectedIndex + 1;
finalSearchString = “”;
if(searchEngine == 1){
finalSearchString = “http://www.google.com/search?hl=&source=hp&q=” + searchString;
}
if(searchEngine == 2){
finalSearchString = “http://search.yahoo.com/search?p=” + searchString;
}
if(searchEngine == 3){
finalSearchString = “http://www.bing.com/search?q=” + searchString;
}
window.open(finalSearchString);
}
}
</script>
<style type=”text/css”>
<!–
#iconselect {
background: url(images/select-bg.gif) no-repeat;
height: 25px;
width: 250px;
font: 13px Arial, Helvetica, sans-serif;
padding-left: 15px;
padding-top: 4px;
}
.selectitems {
width:230px;
height:25px;
border-bottom: dashed 1px #ddd;
padding-left:10px;
padding-top:2px;
}
.selectitems span {
margin-left: 5px;
}
#iconselectholder {
width: 250px;
overflow: auto;
display:none;
position:absolute;
background-color:#FFF5EC;
}
.hoverclass{
background-color:#FFFFFF;
curson:hand;}
.selectedclass{
background-color:#FFFF99;
}
–>
</style>
</head>
<body>
<form name=”SEARCH” onSubmit=”startSearch(‘SEARCH’); return false;” >
<input name=”searchText” type=”text” style=”WIDTH: 417px; HEIGHT: 20px”>
<select name=”whichEngine” id=”customselector” >
<option title=”../icons/google.gif” selected=”selected” >google</option>
<option title=”../icons/yahoo.gif”>yahoo</option>
<option title=”../icons/bing.gif”>bing</option>
</select>
<input type=”submit” value=”Search” onClick=”startSearch(‘SEARCH’); return false;” style=” HEIGHT: 41px”>
</form>
</body>
</html>
Any ideas…?