Nah, i’m running it after the form which is also at the very bottom >_>
i’d paste that code but it’s a mess at the moment because I just condensed 3 different modules into one.
Nah, i’m running it after the form which is also at the very bottom >_>
i’d paste that code but it’s a mess at the moment because I just condensed 3 different modules into one.
Well for the sake of reference, here is a simple test page that demonstrates the technique working fine.
<html>
<head>
<style type="text/css">
#searchForm {
text-align: center;
}
.searchfield {
width: 280px;
}
</style>
</head>
<body>
<div id="searchForm">
<form id="search" action="http://www.google.com/search">
<input type="submit" value="Search" class="searchbutton">
<input id="searchtext" name="q" class="searchfield">
</form>
</div>
<script type="text/javascript">
var form = document.getElementById('search');
form.onsubmit = function () {
var form = this,
domain = form.action.match(/^(http:\\/\\/[a-zA-Z.]+)/)[1],
searchtext = form.elements.q.value;
location.href = domain + '#q=' + searchtext;
return false;
}
</script>
</body>
</html>
phew finally got it working, thanks for everyone’s help!
the issue with your solution paul turned out to be that my processing script was expectin ‘Search’ and not ‘search’ on a linux server. whoops! i didn’t even mean to use any capitals in the first place