>> <form id="one" >
>>   // lots of widgets
>>   <div id="foo" />
>>   // lots more widgets
>> </form>
>> <form id="two" drawAt="foo">
>>   // one little widget?
>> </form>
>>
>> Any other suggestions?

Here's mine, assuming you don't mind the "sub"-form elements to be
submitted (and perhaps ignored) if the "outer"-form gets submitted, and
assuming that you don't have so many parameter that the following
becomes intractable:

<form name="MainForm" ... >
  <!-- blah blah blah -->
  <input type="text" id="email" ... />
  <input type="button"
      onclick="
          document.NewEmailForm.email.value
              = document.getElementById('email').value;
          document.NewEmailForm.submit();"
      value="Add Email" />
  <!-- blah blah blah -->
</form>

<form name="NewEmailForm" ... >
  <input type="hidden" name="email" />
</form>


i.e. create all your forms, non-nested (since you can't nest 'em, hehe),
and then use JavaScript to populate and submit the appropriate form as
needed.


Also, if you only have a few simple form-parameters, and you know the
URL you're going to be submitting to, you could do away with the
separate form entirely by using a GET submission -- i.e. encode your
parameters into the URL.  Refactoring the above example:

  ...
  <input type="button"
      onclick="window.location='...?email=' +
document.getElementById('email').value;" />
  ...


Jim Steinberger
Dynamic Edge, Inc.

-----Original Message-----
From: Patrick Casey [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 17, 2005 12:43 PM
To: 'Tapestry users'
Subject: Slightly OT, General HTML Form Question

 

            Hi folks,

 

            I was wondering if anyone out there had found a way to solve
a
particular problem I've been dancing around for the last few weeks.

 

            I've got a big form e.g.

 

            <form>

                        // lots of widgets

                        // one little widget

                        // lots more widgets

            </form>

 

            Sometimes, I need to submit the big "uber" form in all its
30
widgets worth of glory.

 

            Sometimes though, if the user pushes, for example, "add new
email address", all I really want to do is submit the "emailAddress"
widget,
add the address to the Set on the server, and then re-render the page.
In
the best of all possible worlds, I'd like to be able to do this:

 

            <form id="one" >

                        // lots of widgets

                        <form id="two" >

                                    // one little widget

                        </form>

                        // lots more widgets

            </form>

 

            As we all know though, that's a non starter in HTML :-).

 

            Can anyone suggest a way I can "stuff" a small form inside a
larger one? I was thinking perhaps I could do something with CSS and
positioning? I'm not the world's best CSS guy unfortunately (I still
table
layout virtually everything), but is there any way to do something like:

 

            <form id="one" >

                        // lots of widgets

                        <div id="foo" />

                        // lots more widgets

            </form>

            <form id="two" drawAt="foo">

                        // one little widget?

            </form>

            

            Any other suggestions?

 

            --- Pat

            

 

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to