...

View Full Version : Forms and URL's



milenia
08-03-2002, 11:41 AM
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

mordred
08-03-2002, 04:20 PM
If you have a hidden form field called "url" reserved for this functionality, you can use this in the <form> tag of your form:



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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum