For sake of completeness I went ahead and converted your code to PrototypeJS. I optimized the code a bit (sorry can't help it) to exit when the first empty field is found.
<script type="text/javascript">
document.observe('dom:loaded',function(){
$$('form > input').invoke('observe','keyup',function() {
var empty = false;
$$('form > input').each(function() {
if (this.value == '') {
empty = true;
throw $break;
}
});
$('search').writeAttribute('disabled',empty);
});
});
</script>
<form>
FROM<br />
<input type="text"/><br />
TO<br />
<input type="text"/><br />
<input type="submit" id="search" value="GO" disabled="disabled" />
</form>