1

I have a sub-form in main form like

<form method="post" action="/books/addbook" id="mainForm">
 //some controls....
 <form method="post" action="/books/addbookAuthor" id="subForm">
   //some controls......
   <input type="submit" value="Add author" id="submit_subForm" />
   //some controls......
 </form>
 //some controls....
 <input type="submit" value="Add author" id="submit_mainForm" />
</form>

What I want is when user click "submit_subForm" only the "subForm" submit not the "mainForm". How can I do that????

Hala Aly
  • 141
  • 2
  • 13

1 Answers1

0

HTML itself does not allow for nested forms so you won't be able to do this.

Wil
  • 2,328
  • 2
  • 20
  • 27