Basically, you rock. I paid some dude on fiverr to write that snippet for me and obviously it didn’t turn out so well.
This is the code I ended up with, in case someone else want to have a jump to page text box:
<script type="text/javascript">
function redirect_to(){
var pathname = window.location.host;
var s = document.getElementById('redirect_s').value;
if(s == "")
{
alert('Please Enter the number in textbox');
}
else{
location.replace( "/" + s) ;
}
}
</script>
<form method="post" action="javascript:redirect_to();">
<label class="assistive-text" for="s">Search</label>
<input value="" id="redirect_s" class="field" placeholder="Jump to image #" name="redirect_s" type="text">
<input id="searchsubmit" class="submit" value="Search" name="submit" type="submit">
</form>
Thanks again, Chandan!