Styleforum › Forums › General › General Chat › Easy HTML question
New Posts  All Forums:Forum Nav:

Easy HTML question

post #1 of 6
Thread Starter 
What is the easiest way to take user input text boxes and incorporate them into the URL?

For example:

Text box 1: "style"
Text box 2: "forum"

Resulting URL: www.website.com/style-forum.htm

Is this doable with pure HTML or do I need to use Java? Can someone type this out? I am making a cool app for the forum.
post #2 of 6
I don't know of a way to do that with just HTML. You could use a little client-side JavaScript in an onsubmit() handler for the form which would take the values from the text box(es) and formulate the target URL accordingly.

Or, you could do some server-side thing that would receive the form post, synthesize the desired URL from the form values, then send a redirect with the desired URL.

I'm guessing you don't have access for server-side scripts, so JavaScript is probably the way to go.
post #3 of 6
Use the <form> feature?

http://www.xyz.com?input1='abcdefg'
post #4 of 6
Thread Starter 
Quote:
Originally Posted by mintyfresh View Post
Use the <form> feature?

http://www.xyz.com?input1='abcdefg'

Thanks guys. Mintyfresh, could you give me a clearer syntax for this? How would it look with two inputs?

http://www.xyz.com?input1?input2

??
post #5 of 6
It'll be of the form http://www.example.org?input1=value1&input2=value2[&input3=value3...] Just be sure to use a GET rather than a POST in your HTML <form>. If this form works for you, great...but it's not quite the same as http://www.example.org/value1-value2.htm in your original example.
post #6 of 6
Yep - Binge answered your question. http://www.w3schools.com/TAGS/att_form_method.asp
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: General Chat
Styleforum › Forums › General › General Chat › Easy HTML question