• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Add a row to table and update data

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to add a row to a html table and the column (<td> will be an input field with type=text. I would like to name the input field and be able to update it using the name.

I can crete a table with a input field column, name it and update it.

I can add a row to table.

I can not add a row to a table with a input field column.

Any suggestions would be much appreciated, Lisa
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would this help?
http://www.mredkj.com/tutorials/tableaddrow.html

Eric
 
Lisa Zapson
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

I can add a row to a table, just like your link describes. But I can not figure out how to add a row as a input field.

<td><input type=text name="newColumn" value="new"></td>

I would like to add it as an input field so I can update it using the name attribute.

Thanks so much for your help, any other ideas would be appreciated. Lisa
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that code inserts a text filed so you can edit it by:

var theBlah = document.formName("txtRow" + number).value;

Eric
 
Lisa Zapson
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for pointing that out. I will try it.

Thanks for your help, Lisa
 
Lisa Zapson
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can not seem to access the row I inserted by referencing the name.

I am not using a form. I tried using a form and it didn't seem to make a difference.

If I add a row to a table

<td><input type="text" name="txtRow1" size="40" /></td>
I try to change the value of the row in a javascript function
txtRow1.value = "100"
it works fine.

If I add a row dynamically using the code in http://www.mredkj.com/tutorials/tableaddrow.html I am not able to update the row later by name. Even when I view source the row does not display in the source.

Any thoughts? Lisa
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic