Re: Self Submitting Form

From: Date: Sat, 21 Feb 2004 01:07:14 +0000
Subject: Re: Self Submitting Form
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-178420@lists.php.net to get a copy of this message
Hi Sam, I am not sure I know what you want to do... I tried to recreate your problem: test.html <form name="myform1" method="get" action=""> <input type="hidden" name="myvar1" value="testing"> <script> window.open("test2.html", "test"); </script> </form> test2.html <BODY onLoad="document.forms[0].submit();"> <form name="myform1" method="get" action="test3.html"> <INPUT TYPE="hidden" NAME="do_preview" VALUE="1"> <script> document.write('<INPUT TYPE="hidden" NAME="itworks" VALUE="'+opener.myform1.myvar1.value+'">'); </script> </FORM> </BODY> test3.html <script language="Javascript"> function parseQueryString (str) { str = str ? str : location.search; var query = str.charAt(0) == '?' ? str.substring(1) : str; var args = new Object(); if (query) { var fields = query.split('&'); for (var f = 0; f < fields.length; f++) { var field = fields[f].split('='); args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' ')); } } return args; } var args = parseQueryString (); for (var arg in args) { document.write(arg + ': ' + args[arg] + '<BR>'); } </script> And the output is: do_preview: 1 itworks: testing As should be expected... Pls try to specify your problem. toby

« previous php.general (#178420) next »