On which page is the Enter button?
I might have misunderstood what you wanted as that script was to redirect the initial page by a script running in the page that is opened.
If your button is on the page you want to redirect you just need
document.location.href = url;
and a onclick event on your button to call that.
Maybe if you post the relevant bit of your current code someone can give you the exact change required