File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Problem while Adding table body thru javascript 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 "Problem while Adding table body thru javascript" Watch "Problem while Adding table body thru javascript" New topic
Author

Problem while Adding table body thru javascript

Deepa More
Ranch Hand

Joined: May 22, 2006
Posts: 68
I am calling java script function on click of button, which adds content to tbody using appendChild. Problem I am facing is, when I move cursor to input-text added, then only its value get displayed whereas the value is set already in that function while creating it.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
um, can you show us some code.

Eric
Deepa More
Ranch Hand

Joined: May 22, 2006
Posts: 68
Function which adds data is:

function addData(name)
{
container = document.getElementById('details');
newRow = container.childNodes[0];
var nameTxtBox = newRow.childNodes[2].childNodes[0];
nameTxtBox.value = name;
nameTxtBox.style.visibility = 'visible';
container.appendChild(newRow);
}
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem while Adding table body thru javascript
 
Similar Threads
question
adding numbers
Form Submission on drop down onchange event
Data conversion in Hibernate
How to retrieve string representation of <INPUT> value?