Connecting Tech Pros Worldwide Help | Site Map

nested forms

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 04:10 PM
Michael Hill
Guest
 
Posts: n/a
Default nested forms

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



  #2  
Old July 20th, 2005, 04:10 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: nested forms

Michael Hill <hillmw@ram.lmtas.lmco.com> wrote:
[color=blue]
> Is it possible to have nested forms?[/color]

No, the HTML syntax explicitly forbids them.
[color=blue]
> 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[/color]

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

  #3  
Old July 20th, 2005, 04:10 PM
Darin McGrew
Guest
 
Posts: n/a
Default Re: nested forms

Michael Hill <nospamhillmw@ram.lmtas.lmco.com> wrote:[color=blue]
> Is it possible to have nested forms?[/color]

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, mcgrew@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin@htmlhelp.com, http://www.HTMLHelp.com/

"There is no right way to do the wrong thing."
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.