Rik Comery
06-21-2004, 03:43 AM
Hi. I have built a form which submits the results to a database. All the values of the form are filled out by the user, with the exception of one. This field, i would like to to be the URL of the form. (The page is dynamic, so the address could be one of several posibilities).
Here is the bit that i am having trouble with.
<form name="form">
<input type="hidden" name="address1" value="">
</form>
<script>
document.form.address1.value=document.location
</script>
This works fine, until the URL contains an &. Once the form is submitted, the page thinks that the & signifies the next field.
Is there some way around this?
Ultimately, i would like a URL submitted to the database, that resembles the following:
www.something.com/file.htm?param1=true¶m2=false
Here is the bit that i am having trouble with.
<form name="form">
<input type="hidden" name="address1" value="">
</form>
<script>
document.form.address1.value=document.location
</script>
This works fine, until the URL contains an &. Once the form is submitted, the page thinks that the & signifies the next field.
Is there some way around this?
Ultimately, i would like a URL submitted to the database, that resembles the following:
www.something.com/file.htm?param1=true¶m2=false