Link to home
Start Free TrialLog in
Avatar of niftyhawk
niftyhawk

asked on

Nested Form Tags and Javascript

Hi,

It appears nested forms do not work.. I have the following piece of code, which I had to simplify inorder to present my case.

<form name="aform" method="post" action="newfile.php">
      <input type="text" name="abc" value="somevalue">
      <input type="button" value="button" onclick="document.aform.submit();">

      <form name="bform" method="post" action="somefile.php">
      <input type="text" name="def" value="testvalue">
      <input type="button" value="button" onclick="document.bform.submit();">
      </form>
</form>


Can any body tell me why bform is not recognized by javascript and if there are any alterantives possible.. inorder to make this work..

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of niftyhawk
niftyhawk

ASKER

well, the real use of having nested forms is... the outer form has a table with rows having checkboxes and text boxes.. the user can manage checked items options by checking the check boxes and deleting them or modifying them. the inner form has multiple checkboxes and textboxes for each row of the outer form.
So it's just a structure thing? I'm afraid the only way you can get any structure is to maybe surround your form elements with an IDed <div> or make your name your forms a certain way.

Ted
hmm..all my inner forms have a differentname and action..however, they have to be surrounded by an outer form, otherwise how would I know what variables have been passed during the form post?
I'm not too sure what you mean... What are you trying to do exactly, and what do you expect the structure of your $_POST array to be?

Ted