• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

multiple form question

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic