File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add a row to table and update data

 
Lisa Zapson
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would this help?
http://www.mredkj.com/tutorials/tableaddrow.html

Eric
 
Lisa Zapson
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic