0

I'm new to javascript and this is probably really simple and obvious, but I can't find the answer anywhere.

I want a specific form response to send the user to a specific page, for example, typing "one" and hitting enter would take them to the page "/one.html" if that makes sense? Any help?

1 Answer 1

2
document.location = document.getElementById('yourinputfield').value() + '.html';
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, but I don't know what context to put that in? If I have 4 pages to choose from, do I put that in if statement format? If so, how? I'm seriously a beginning beginner, I'm clueless! D:
you'd put it into an onsubmit, or onchange in your form. if you want to restrict where the users can choose to go, then don't let them type in anything. just give them a dropdown or checkboxes or whatever and work from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.