They've used javascript, which I personally wouldn't have used. I know a little javascript and would consider changing the button type input to a submit type, and adding the onSubmit event with the function call.
But, I'm not in a position to test that. So, what I would do is get rid of the relevant javascript and instead, have a script called subdir.php and change the form to this:
Code:
<form action="subdir.php" method="post">
<div id="container">
<h1></h1>
<input type="text" name="subdir">
<input type="submit" value="OK">
</div>
</form>
Then, in subdir.php, I would have this:
PHP Code:
// Put user requested subdir into variable. Probably needs cleaning, in case of 'dodgey' url's containing things like .. or /'s
$subdir = $_POST['subdir'];
header('location: http://www.example.com/'.$subdir.'/');
That will redirect the user to the subdir they entered - whether they pressed enter or clicked the button. Using PHP allows for expansion and a more secure environment to navigate folders in my opinion.