/    Sign up×
Community /Pin to ProfileBookmark

Search doesn’t work

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”[/U] it does work again but then I lose the other (verry cool…) piece of js wich it is referring to:

[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>[/code]

Any ideas…?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @yomoore spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...