By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

nested forms

P: n/a
Is it possible to have nested forms?

<form name="form1" method="post" action="pgm1">
<input type="text1">
<form name="form2" method="post" action="pgm2">
<input type="text2">
<input type="submit" value="submit form2">
</form>
<input type="submit" value="submit form1">
</form>

and when form1 is submitted action is agaisnt pgm1 with vars from from1
and when form2 is submitted action is against pgm2 with vars from form2
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Michael Hill <hi****@ram.lmtas.lmco.com> wrote:
Is it possible to have nested forms?
No, the HTML syntax explicitly forbids them.
and when form1 is submitted action is agaisnt pgm1 with vars from
from1 and when form2 is submitted action is against pgm2 with vars
from form2


No, you need to use a single form with two submit buttons and to set up
the server-side form handler so that it recognizes which button was
used and branches accordingly.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #2

P: n/a
Michael Hill <no**********@ram.lmtas.lmco.com> wrote:
Is it possible to have nested forms?


No.

But it is possible to have a single form with multiple submit buttons, and
a server-side (e.g., CGI) program that does different things depending on
what submit button was used.

See also http://www.htmlhelp.com/faq/html/forms.html#two-submit
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"There is no right way to do the wrong thing."
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.