aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes multiple form question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "multiple form question" Watch "multiple form question" New topic
Author

multiple form question

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I am building a shopping cart web application. In the admin section I have ten items per page and each item has 10 columns of info that can be updated. Someone suggested to me that the most common technique is to make each item a separate form. But how would I do that since I have an additional restriction that I need to be able to update multiple items at the same time. I was wondering if someone could shed some light. How can I determine the best way to indicate which forms need to be updated?
Thanks for your time
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It all depends on what you have information wise and how you link that information to the form name.
With what you gave me, I have no clue how to guide you.
Eric
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
I am not sure how common that is
Just an idea for you:
If you have a uniq id for each item, than you can do:
<form>
loop to print item info
{
<input name="id" type="hidden" value="<%=itemId%>">
<input name="prop1" type=text value="<%=itemProp1%>">
<input name="prop2" type=text value="<%=itemProp1%>">
}
</form>
than on server you can use
String[] ids = request.getParameterValues("id");
String[] props1 = request.getParameterValues("prop1");
String[] props1 = request.getParameterValues("prop2");
than loop through ids, and for item with id[i] set prop1 to props1[i] and prop2 to props2[i].
Client side gets a little bit more complicated if you need to use checkboxes, but not much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: multiple form question
 
Similar Threads
form with submit option
Dynamic Table Issue
Two dimensional constructs
Design question
Jsp and html elements