javascript submit() not setting $_POST data!

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

aewarnick

Thread Starter
Joined
Sep 3, 2002
Messages
828
Is this a common problem with javascript:submit()?
I'm creating this form dynamically when the user wants to remove some images and change image descriptions with this code:
PHP:
<script type="text/javascript">
<!--
function SubmitChanges()
{
	var Cat="<?=$Cat;?>", start="<?=$start;?>", page="<?=MakeHtmlPath($_SERVER['SCRIPT_FILENAME']);?>", delOk= 0, asked= 0;
	
	document.write("<H2>Processing...Please Wait...</H2><form name='javascriptSubmitForm' method='post' action='\''+page+'\''> <input name='Cat' type='hidden' value='\''+Cat+'\''> <input name='start' type='hidden' value='\''+start+'\''>");

	for(var f=0; f<document.forms.length; ++f)
	{
		if(document.forms[f].name=="editForm")
		{
			document.write("<input name='im[]' type='button' value='\''+document.forms[f].im.value+'\''>");
			
			if(document.forms[f].desc.value.indexOf('<') != -1 || document.forms[f].desc.value.indexOf('>') != -1)
				document.write("Illegal Character<br>");
			else
				document.write("<input name='desc[]' type='hidden' value='\''+document.forms[f].desc.value+'\''>");

			if(document.forms[f].cb.checked)
			{
				if(!asked) {asked= 1; delOk= confirm("Press Ok to DELETE selected images");}
				document.write("<input name='del[]' type='hidden' value='\''+delOk+'\''>");
			}
		}
	}
	document.write("</form>");
	self.javascriptSubmitForm.submit();
}
//-->
</script>
print_r($_POST); prints:
Array ( [Cat] => [start] => [im] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => ) [desc] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => ) )

The javascript vars are not empty, I checked. Help me find out what is happening, please.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top