Submittng a child form in a nested form using jquery -
i have nested form looks like:
<form method="get" name="mainform" action=<%=response.encodeurl("updateform.jsp")%>> </form> <t:panel script="showselect(3)"> <t:paneltab left="362" width="200px">tab3</t:paneltab> <t:panelbody src="childform.jsp"> </t:panelbody> </t:panel>
child form code:
<form method="get" name="childform" id = "childform" action=<%=response.encodeurl("processchildform.jsp")%>> <span style="padding:0 10px;"> <button class="submitchildformclass" style="width:auto;" id="submitchildform" >process child form </button> </span> </form>
i wanted submit child form when click on submitchildform button wrote below jquery handler that:
$('.submitchildformclass').live('click',function() { document.getelementbyid("previewonlyval").value = "previewonly"; $('#childform').submit(); });
the problem when click on button, main form gets submitted instead of child form. know isn't programming practice use nested forms old code , not have time yet revise these codes. can tell me might missing in codes causes main form submitted jquery? in advance help.
nesting of forms not allowed! have several forms nesting not allowed.
Comments
Post a Comment