Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Problem with input box / adding text to url

Posted by: brasskneecap Oct 30 2012, 09:04 PM

ive been reading all over the forums and have not found a solution that has solved my problem
what I want to do is have an input box where you where enter text and then it will append that to the end of a url
for example append example to the end so it looks like
http://rfcompliance.com/example that way it will take them to the page named example the code I have so far looks like this I know its probably way off but its something

<html>
<FORM method="get" name="form" action="http://rfcompliance.com">
<INPUT type="text" name="page" value="example">
<INPUT type="submit" value="Submit">
</FORM>

</html>

if theres any information I havent given that would be helpful just ask please

Posted by: Christian J Oct 31 2012, 07:52 AM

CODE
<FORM method="get" name="form" action="http://rfcompliance.com">
<INPUT type="text" name="page" value="example">
<INPUT type="submit" value="Submit">
</FORM>

The above form should load the URL

CODE
http://rfcompliance.com/?page=example

To load only
CODE
http://rfcompliance.com/example

you need extra scripting in order to remove the ?page= part. This is best done by a server-side script at http://rfcompliance.com.

Posted by: brasskneecap Oct 31 2012, 09:10 AM

QUOTE(Christian J @ Oct 31 2012, 08:52 AM) *

CODE
<FORM method="get" name="form" action="http://rfcompliance.com">
<INPUT type="text" name="page" value="example">
<INPUT type="submit" value="Submit">
</FORM>

The above form should load the URL

CODE
http://rfcompliance.com/?page=example

To load only
CODE
http://rfcompliance.com/example

you need extra scripting in order to remove the ?page= part. This is best done by a server-side script at http://rfcompliance.com.


I actually screwed up on the web address its rfsafetycompliance.com but that doesnt matter much I suppose anyways
having read a lot I saw a few things where they used javascript with part of the code but im fairly new to both Html and Java so I was wondering if you could give me some pointers on how exactly I could write this code so that I get the desired outcome that im looking for

Posted by: Darin McGrew Oct 31 2012, 10:00 AM

Why not just link to the available pages, rather than making the user guess which keyword to add to create the URL of an existing page?

Posted by: pandy Oct 31 2012, 12:10 PM

I agree with Darin, but how to do what you want is covered in the FAQ.
http://htmlhelp.com/faq/html/forms.html#form-navmenu

Posted by: brasskneecap Oct 31 2012, 12:26 PM

QUOTE(Darin McGrew @ Oct 31 2012, 11:00 AM) *

Why not just link to the available pages, rather than making the user guess which keyword to add to create the URL of an existing page?


the way the website is built the webpage is so that clients who have a specific code come in and type that code in to the input box and it will take them to a page that has the information that they are looking for, there is already a button that does exactly that works only in google chrome for some reason and it has been challenge trying to make it compatible throughout all browsers.
And as far as changing the way that's done its not my webpage im just doing work on it

Posted by: pandy Oct 31 2012, 12:40 PM

Do you realize that's totally unsafe?

Posted by: Christian J Oct 31 2012, 08:10 PM

pandy is correct, for any kind of safety a server-side solution is necessary. How to do it may depend on what and how much content you want to display, how many different users are involved, etc. More details are needed...

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)