Creating dynamic hyperlink from form input

Hey guys,
This is my first question on this forum, so I hope you'll be able to help. I want to place a form on a Sharepoint site. I want to be able to enter a number into that form and have it take me to the following hyperlink:
ttp://server/page/Main.htm?ServerFilter="PRNumber=VARIABLE"
ie:
ttp://server/page/Main.htm?ServerFilter="PRNumber=8786"
or
ttp://server/page/Main.htm?ServerFilter="PRNumber=8121"
Hopefully pretty simple.

Cool, but there is one problem. It only works sometimes. For instance, I placed the HTML code on my desktop and saved the text as .htm-

Open the file in IE and click to accept blocked content. Then I entered a number. Sometimes it works and goes to the document.location url.. but sometimes it just goes to:ile:///C:/Documents%20and%20Settings/bomgardd/Desktop/pr.htm?number=32155

Not working again.. I reset all the settings to default in IE and still no go. I have no group policy added and IE is at default. WTF? Anyone have any ideas on how to get this script to work. still not grabbing the document.location.. just appending the pr number to the end of the current working directory.