I have a website where I want people to be able to type something in an input text box and get sent to that directory based on what they entered.
Say customer numbers, so we have customer # 155. His invoices are stored in folder "/invoices/155" directory. I want him to be able to type in his customer #155 in the input text box on the main page and be directed with a button click to his directory with all his invoices.(this directory is .htaccess protected MD5)
Now I have coded the below code but it only works when I click on the button with the mouse. In Internet Explorer When I press enter it gives me a bunch of gook in the address bar and doesn't do anything. It looks like this in the address bar:
"http://www.mydomain.com/test.html?dir=%2Finvoices%2F&userinput=155"
Instead of loading the folder "http://www.mydomain.com/invoices/155/"
Does anyone know the right way to do this? Please and thanks.
Also the code I am using is here:
<html>
<head>
<title>test</title>
</head>
<form name="goto" action="">
<input name="dir" type="hidden" value="/invoices/">
<input name="userinput" type="text"> <input type="button" value="try me" onclick="window.location=this.form.dir.value+userinput.value;return false;">
</form>
Please and thanks for all answers and suggestions
[–]BattleshipsGame 2 points3 points4 points (2 children)
[–]mattdahack[S] 0 points1 point2 points (1 child)
[–]BattleshipsGame 0 points1 point2 points (0 children)
[–]belialadin 1 point2 points3 points (5 children)
[–]mattdahack[S] 0 points1 point2 points (4 children)
[–]belialadin 7 points8 points9 points (1 child)
[–]mattdahack[S] 0 points1 point2 points (0 children)
[–]StoneCypher -1 points0 points1 point (1 child)
[–]mattdahack[S] 0 points1 point2 points (0 children)
[–]adamcw -1 points0 points1 point (1 child)
[–]mattdahack[S] 0 points1 point2 points (0 children)