• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Submit buttons within table rows...

 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose you have a table of items, each item has its own unique row. Each row has a button which, when selected, allows you to change the data in any one of the cells for the item in that particular row. If the button has a name attribute and a value which is identical for every row, how do you know which particular button was clicked?
Does html allow you to use a variable for an attribute, like so:
String row = "one" ;
<input name=' + row + ' type=submit method=post>
Or is there some other way to label each row of table data within a table so you can identify all of the infomation in any one row exclusive of the other rows?
I'm trying to access each row of table data by clicking a button in the last cell of each row. Since all of the buttons have the same value, how do I determine which particular button was clicked?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes you can use the name attribute of the buttons...I am guessing that this is server side based with the form being submitted. The problem I see is you have all of these submit butons and one form??
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are two ways around that potential problem. use seperate forms for each submit. or use type="button" rather than type="submit" and on_click do a form.submit
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic