2

I've seen examples of a form being submitted and a new window being opened via _blank. However, I can't seem to reproduce the results. See my code, below.

In the <head> tag:

<script type="text/javascript" lang="javascript">
    function submitForm(formId) {
        newDialog = window.open('http://redhue.ir/upload/upload.php', '_form','status=no,scrollbars=no');
        document.forms[formId].target='_form';
        document.forms[formId].submit();
        return false;
    }
</script>

In the <body> tag:

<form action="#" method="post" enctype="multipart/form-data" onsubmit="return submitForm(this)">

But it just opens the new window and goes to test.php, but the form doesn't work, and there is no POST action, which means that test.php does not receive any form input.

What am I doing wrong, and how can this issue be resolved?

4

0 回答 0