Search bar (help)
Posted: 13 Aug 2012, 02:41
Here is what i got please if you can tell me why its not working it would help me out alot. what im trying to make is something like the unofficial site bar by blr419..
Code: Select all
<SCRIPT type="text/javascript">
function searchSel() {
var input = document.getElementById('realtxt').value.toLowerCase();
var output = document.getElementById('realitems').options;
for (var i = 0; i < output.length; i++) {
if (output[i].value.indexOf(input) == 0) {
output[i].selected = true;
}
if (document.forms[0].realtxt.value == '') {
output[0].selected = true;
}
}
}
</SCRIPT></HEAD><BODY>
<FORM>
Search <input type="text" id="realtxt" onkeyup="searchSel()" size="20">
<SELECT id="realitems">
<OPTION value="">Select...
<OPTION value="http://google.com">Google
<OPTION value="http://yahoo.com">Yahoo
<OPTION value="http://msn.com">MSN
</SELECT>
<input type="button"
onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;"
value="GO">
</p>
</form>