views:

27

answers:

1

Hello everyone and thanks in advance. I have a problem and I have 2 form into one another, the domestic form is to perform a file upload. As I can do to make when sending in internal form not run the main form.

<form name="x" method="post" action="xxx.php">
 ....         

   <form action="" method="post" enctype="multipart/form-data" target="xxx">

      <input type="file" />

      <input type="submit" />

   </form>

   <iframe id="xxx" src="process.php">
   </iframe>

 ....
 <input type="submit" name="pro" value="Register user"/ >
</form>

Doing this does not work, as this within another form. Any help or possible solution.

+2  A: 

Forms cannot be nested. That's simply is not allowed in HTML and if you do so you might get undefined behavior which could vary between browsers. So try removing the inner form and put the enctype on the outer form.

Darin Dimitrov
there would be some other solution?
Alexd2
Solution for what? You never mentioned what is your scenario and what are you trying to achieve.
Darin Dimitrov
the problem is by design, which is why groups that form into another, with a plugin (jQuery or another) could make the ascent of the file, without using another form
Alexd2
+1 `Forms cannot be nested.`
NAVEED