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????
HTML itself does not allow for nested forms so you won’t be able to do this.