View Full Version : Konqueror and Opera Problems

12-16-2006, 10:28 PM
I am creating a chat script that uses PHP and Javascript. For part of it I need to empty one of the text boxes. The scripts I use work fine in IE and Firefox, however the the text box will not clear in Opera and Konqueror. I have tried the follwoing:

document.getElementById('commentbox').innerHTML = '';

document.chatform.comment.value = "";

Like I said they are both fine in IE and Firefox, but not in Konqueror or Opera. I have searched for hours looking for code that will work.

Thanks in advance.

12-16-2006, 10:57 PM
What kind of element is commentbox? Have you tried document.getElementById("commentbox").value? Your first example makes use of code proprietary to Microsoft (innerHTML) and the second uses what I believe is the traditional, non‐standard method of selecting elements.

12-16-2006, 11:01 PM
commentbox is a <textarea> with the id "commentbox".
does not work either.

12-16-2006, 11:03 PM
document.getElementById('elementid').value = '';

works for me in ie, moz and opera, cant test konqueror