Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Konqueror and Opera Problems

    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:
    Code:
    document.getElementById('commentbox').innerHTML = '';
    and
    Code:
    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.

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    commentbox is a <textarea> with the id "commentbox".
    Code:
    document.getElementById("commentbox").value
    does not work either.

  • #4
    New Coder
    Join Date
    Dec 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.getElementById('elementid').value = '';

    works for me in ie, moz and opera, cant test konqueror
    http://demo.vegui.org - vegUI AJAX framework
    http://www.landsofkazram.com - browser based graphical MMORPG


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •