Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy current url in text field

Status
Not open for further replies.

missplume

Technical User
Sep 4, 2001
29
US
I am trying to add an "email this page to a friend" using FormMail.
The one piece of the puzzle I am currently missing is how to make the current page url copy itself into one of the form fields.
Thanks
 
try:
<input type=&quot;text&quot; value=&quot;<script>document.write(document.location)</script>&quot;>
 
u cannot do it using javascript if the email form is going to be on a different page. is it on the same page?

Known is handfull, Unknown is worldfull
 
Thank you!
Yes I will be using it on the same page.
 
then do this:
<script>
function FillFrm()
{
document.formName.URLField.value=&quot;URL Here&quot;
}
</script>
<a href=&quot;javascript:FillFrm()&quot;>Mail to friend</a>

formName - Form Name
URLField - Where the valu has to go...


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top