Forum Moderators: open

Message Too Old, No Replies

Redirect to address entered in form

         

thewebdevil

2:33 pm on Jun 2, 2007 (gmt 0)

10+ Year Member



I am making a website for a photographer and she wants to have an input field where her clients can type in a partial address that she gives them and when submitted will redirect them to their proof page.

Ex: She gives them the code "jhaywood"
They type in "jhaywood" in an input field
the form redirects the page to: "http://www.examplesite.com/proofs/jhaywood"

How can this be accomplished in javascript?

mehh

8:46 pm on Jun 2, 2007 (gmt 0)

10+ Year Member



if you where already in the folder proofs you could do this:

<script type="text/javascript">
function SubmitHandeler(){
window.location.href=document.getElementById('navInput').value+".html";
return false;
}
</script>
<form onsubmit="return SubmitHandeler();">
<input id="navInput" type="text">
</form>

thewebdevil

8:49 pm on Jun 14, 2007 (gmt 0)

10+ Year Member



That worked like a charm. Thanks for your help!