If you are using GET for your forms, you can do this:
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
document.write(pair[0]);
}
If you are using POST you must use a server-side script to do this.
Agent Michael Scarn wrote:
Quote:
Hello,
>
I need to be able to dynamically display all of the form names from a
form I just submitted.
>
I have a javascript which will display all the names of the form on the
first page, but i need them displayed on the post page.
>
Any help would be greatly appreciated!
>
Here is the javascript that works on the first page...
>
<script language="JavaScript" type="text/javascript">
<!--
var myForm = document.forms.f;
var elements = ""
for (i = 0; i < myForm.elements.length; i++)
elements = elements + myForm.elements[i].name + "&";
// -->
</script>
>
<script language="JavaScript" type="text/javascript">
<!--
document.write(elements);
// -->
</script>
>
Thanks!