Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem setting TD tag innerHTML

 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic