You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ajay Patil <ap...@vertex.co.in> on 2003/07/17 07:46:30 UTC

Multiple forms on same page

Dear Jing,

In the scenario that you describe (Multiple forms on same HTML page) -

The browser will send only the data inputted on the form whose submit
button is clicked. The data inputted in other forms will not be
sent to the server, and so there is no way the server can send it
back in the next page.

I think the only way to solve this problem is to control the HTML
so that only one form is editable at a time.

Thus, the detail form becomes editable only when you click on "Edit"
detail button. (and when the detail form is editable, the master
form is not editable).

You can also show/hide forms to achieve a similar effect. Though this
is possible in Javascript, I like to do it in JSP on server-side, using
a state property in the form class to indicate what state the form
is currently in.

Let me know what you think,
Ajay

> Thanks for your inputs. It is a practical solution.
> But it looks to me that it doesn't offer sufficient
> justification for the use of multiple html forms.
> If I understand you right, your master form and
> detail form are actually combined in one html form?
> So any submit buttons will trigger both forms
> being submitted.

> I am not sure we can safely say one html form
> per page is sufficient for general web applications.
> It was a design decision I made sometime ago
> for our product. But it is still an open/challenging
> question in my mind.

> Jing


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Multiple forms on same page

Posted by Jing Zhou <ji...@netspread.com>.
Hi, Ajay,

I think what you proposed is a very reasonable way to construct a
page with multiple html forms.

When the page is in the master mode, all of the detail form elements
are disabled. When the page is transferred into the detail mode,
the form elements in the master form are disabled and only the
corresponding detail form elements are enabled.

It looks very useful in use cases when end users need to know
information on the mater form to enter data into one of detail forms.

Thanks.

Jing

----- Original Message ----- 
From: "Ajay Patil" <ap...@vertex.co.in>
To: <st...@jakarta.apache.org>
Cc: <ji...@netspread.com>
Sent: Thursday, July 17, 2003 12:46 AM
Subject: Multiple forms on same page


> Dear Jing,
> 
> In the scenario that you describe (Multiple forms on same HTML page) -
> 
> The browser will send only the data inputted on the form whose submit
> button is clicked. The data inputted in other forms will not be
> sent to the server, and so there is no way the server can send it
> back in the next page.
> 
> I think the only way to solve this problem is to control the HTML
> so that only one form is editable at a time.
> 
> Thus, the detail form becomes editable only when you click on "Edit"
> detail button. (and when the detail form is editable, the master
> form is not editable).
> 
> You can also show/hide forms to achieve a similar effect. Though this
> is possible in Javascript, I like to do it in JSP on server-side, using
> a state property in the form class to indicate what state the form
> is currently in.
> 
> Let me know what you think,
> Ajay
> 
> > Thanks for your inputs. It is a practical solution.
> > But it looks to me that it doesn't offer sufficient
> > justification for the use of multiple html forms.
> > If I understand you right, your master form and
> > detail form are actually combined in one html form?
> > So any submit buttons will trigger both forms
> > being submitted.
> 
> > I am not sure we can safely say one html form
> > per page is sufficient for general web applications.
> > It was a design decision I made sometime ago
> > for our product. But it is still an open/challenging
> > question in my mind.
> 
> > Jing
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Multiple forms on same page

Posted by Sandeep Takhar <sa...@yahoo.com>.
The submit will only submit the one form...

sandeep
--- Ajay Patil <ap...@vertex.co.in> wrote:
> Dear Jing,
> 
> In the scenario that you describe (Multiple forms on
> same HTML page) -
> 
> The browser will send only the data inputted on the
> form whose submit
> button is clicked. The data inputted in other forms
> will not be
> sent to the server, and so there is no way the
> server can send it
> back in the next page.
> 
> I think the only way to solve this problem is to
> control the HTML
> so that only one form is editable at a time.
> 
> Thus, the detail form becomes editable only when you
> click on "Edit"
> detail button. (and when the detail form is
> editable, the master
> form is not editable).
> 
> You can also show/hide forms to achieve a similar
> effect. Though this
> is possible in Javascript, I like to do it in JSP on
> server-side, using
> a state property in the form class to indicate what
> state the form
> is currently in.
> 
> Let me know what you think,
> Ajay
> 
> > Thanks for your inputs. It is a practical
> solution.
> > But it looks to me that it doesn't offer
> sufficient
> > justification for the use of multiple html forms.
> > If I understand you right, your master form and
> > detail form are actually combined in one html
> form?
> > So any submit buttons will trigger both forms
> > being submitted.
> 
> > I am not sure we can safely say one html form
> > per page is sufficient for general web
> applications.
> > It was a design decision I made sometime ago
> > for our product. But it is still an
> open/challenging
> > question in my mind.
> 
> > Jing
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org