Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Forms and URL's

  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    Coventry , UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forms and URL's

    Hi,

    I need to make a form automatically put in the URL of the page
    its being sent from. I am trying to eliminate the requests for page 404 and the page I've made requests users to send the addr, to help the URL needs to be filled in.

    I know I have to use window.location and make a hidden
    input type but I do not know how to assign the addr to the form field.

    Thanks,

    milenia

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you have a hidden form field called "url" reserved for this functionality, you can use this in the <form> tag of your form:

    Code:
    onsubmit="this.url.value = location.href;"
    Though I don't understand why you don't write the URL directly into the hidden form field, that would also suit users who have JS disabled.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •