How to disable the HTML code in text area box?

Discussion in 'HTML & Website Design' started by hhheng, Jan 16, 2007.

  1. #1
    I have a guest book on my website, and visitors can insert HTML codes inside the text box. Now the problem is that nobody leave comments about my site, all are introduction and links of other websites. The url is here: www.hkhangfong.com/guestbook.htm . So now I want to disable the function of inputting html code there.

    I'm very curious that I ask visitors to go and submit at my auto approval link directory, but looks like nobody goes there and still get huge fill in there per day, even more than the submission to my directory.
     
    hhheng, Jan 16, 2007 IP
  2. smeggy

    smeggy Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    to do this client side would require javascript and therefore is easily by-passed (if someone wanted to)

    i deal with this type of issue on the server side.
    In the (in my case) perl script that processes the form input I search for html tags and keywords (http, ://, etc) and send back a polite refusal and dump the form contents.

    -Greg
     
    smeggy, Jan 16, 2007 IP
  3. hhheng

    hhheng Banned

    Messages:
    2,633
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #3
    smeggy, can you give me the javascript code in the browser side?
     
    hhheng, Jan 16, 2007 IP