File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Problem setting TD tag innerHTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem setting TD tag innerHTML" Watch "Problem setting TD tag innerHTML" New topic

Problem setting TD tag innerHTML

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
I've posted the function I call below and also the html code that is involved. I keep getting an error message regarding unknown runtime error. ANy idea to why I'm getting this error? Any help appreciated.

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
I should also point out that by removing everything in the script except the getElementById line and adding a line to just set the innerHTML to the TD still gives me the same error. It's like it doesn't like the getElementByID returned value or the innerHTML property.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
What browser are you having the error in. That is important in web development.

Did you test to see what getElementById returns?

You should not name your button submit. It overrides JavaScript functionality. It is also good practice not to name your variables the same the form element names.

Side question:
What are you using that has the equals() method? Did you extend String.prototype?
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
Hi Eric,
Everything you are now looking at is the result of mixing things up to see why things weren't working. Far from the original. As with the naming conventions, this is just something I was playing with to see if I could get it to do what I wanted but, again, the names started out being totally different than they are now. I'm using IE by the way.

I agree. Here's the link:
subject: Problem setting TD tag innerHTML
It's not a secret anymore!