Forum Moderators: open

Message Too Old, No Replies

Need Href help...turning user form input into a hot link

         

Stedman

1:33 pm on May 14, 2004 (gmt 0)

10+ Year Member



Hi,
I'm trying to use a form and have the information which gets typed in the URL space of the form HREF the URL that is typed into it. The spaces would be for name, address, and website. I want the "website" to be a useable link. The page gets submitted to an html page which is then used as an iframe.
Can anyone help?

BlobFisk

2:04 pm on May 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Stedman!

If I understand you correctly you would like to be able to capture a URL typed into a form and use it to be displayed in an iFrame?

If you can use a server side language you can submit the form to the iFrame (using target) and then redirect the form processing page to the URL entered.

You can also use JavaScript. If you set the method on your form to GET:

<form method="GET" action="myPage.html" target="iFrameName">

The data entered into your form is added to the URL:

myPage.html?name=BlobFisk&location=London&URL=www.webmasterworld.com

Then you use JavaScript to captured the URL encoded data and use location.href to redirect the iFrame.

HTH

Stedman

2:21 pm on May 14, 2004 (gmt 0)

10+ Year Member



Actually, I'm pretty new to html, but I'll see if I can explain it a little better.
On a form page, I have these fields to be filled in -
Name
Address
URL

This information is sent to a html page which displays it.

name
address
http:// whatever.com

I get this info ok, but I want the URL to be linked to itself. I then gather this information in an iframe on another display page. I don't know how to link it. Is it <A HREF=" the url info "> What goes here?</A>
Thanks,
Dennis

Edit Reason: De-linked example URL

[edited by: BlobFisk at 2:55 pm (utc) on May 14, 2004]

BlobFisk

2:58 pm on May 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to open the link in the iFrame you need to add a name to the iFrame:

<iframe name="someName" src="path/to/file.hml">

Then, in your link:

<a href="the URL" target="someName" title="Some title information">

The target tells the browser to open the link in the iFrame.

HTH

Stedman

3:33 pm on May 14, 2004 (gmt 0)

10+ Year Member



Hi,
How do I href the text which was just input by the user?
The output looks like http:// www.whatever.com What I want is "http://www.whatever.com" to be a link. I don't know what url the user will type, but I want the href to see the typed info and link it.

Edit Reason: De-linked example URL

[edited by: BlobFisk at 3:37 pm (utc) on May 14, 2004]

Stedman

3:36 pm on May 14, 2004 (gmt 0)

10+ Year Member



Is there something I can put in the <head> to say that everything with www. or http is a URL link?

BlobFisk

3:38 pm on May 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to do this programatically. How are you currently writing the content of the URL form field to the page?