How to submit a form inside a form without submitting the parents form

I have this form like this and i want to submit each form separately depending on which submit button was clicked.

<form action="" method="post">
          <form action="" method="post">

          <input type="submit" value="Do Child" id="insideform">

<input type="submit" value="Do parent" id="parentform">

I just want them treated seperately.

Not sure what the circumstances are.

Maybe you can find some inputs here: :grin:

You are not allowed to nest form elements.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form

3 Likes

If the forms were separate (not nested) you can submit a different form using the form attribute on an input.

IE has no support for this though.

1 Like

Am studying it @PaulOB and @Erik_J

The use is that i hooked a form into another gravity form through their filter function, but it seems my form was inside their form so it does submit using on button, i was looking for a way to make my form appear directly below their own form, especially after so my form starts here, i think i will figure a way out

try this:

<form method="post" action="" id="form1">
 <input type="submit" name="submit" value="form 1" />
</form>
<form method="post" action="" id="form2">
 <input type="submit" name="submit" value="form 2" />
</form>

This is not nested at all, is just too seperate forms. And won’t have any issues with it.

The big problem is having the close tag inside another

I have read the documentation and is obviously not possible to nest a form.

Thank you

2 Likes