The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Problem with input box / adding text to url, im attempting to create an input text box that will add the text to th
brasskneecap
post Oct 30 2012, 09:04 PM
Post #1





Group: Members
Posts: 3
Joined: 30-October 12
Member No.: 18,032



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 31 2012, 07:52 AM
Post #2


.
********

Group: WDG Moderators
Posts: 7,965
Joined: 10-August 06
Member No.: 7



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brasskneecap
post Oct 31 2012, 09:10 AM
Post #3





Group: Members
Posts: 3
Joined: 30-October 12
Member No.: 18,032



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 31 2012, 10:00 AM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,284
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 31 2012, 12:10 PM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,095
Joined: 9-August 06
Member No.: 6



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brasskneecap
post Oct 31 2012, 12:26 PM
Post #6





Group: Members
Posts: 3
Joined: 30-October 12
Member No.: 18,032



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 31 2012, 12:40 PM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,095
Joined: 9-August 06
Member No.: 6



Do you realize that's totally unsafe?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 31 2012, 08:10 PM
Post #8


.
********

Group: WDG Moderators
Posts: 7,965
Joined: 10-August 06
Member No.: 7



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...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 12th December 2018 - 03:59 PM