Jump to content


Photo

Trouble with textarea for an online editor


  • Please log in to reply
3 replies to this topic

#1 dptr1988

dptr1988
  • Members
  • PipPipPip
  • Advanced Member
  • 372 posts

Posted 25 June 2006 - 10:23 PM

I made an online text file editor that uses < TEXTAREA>....< /TEXTAREA> tags for the editor. The problem is that if you try to edit a file that contains < /TEXTAREA> the browser will close the textare right there and the rest of the file after is parsed as HTML. Can I disable the < /TEXTAREA> tag without modifying any of the text. Is there another multi-line editory in HTML that i can put any text into?

Thanks
Need more help with your project? One of the thousands of programmers, web designers or artists at <a href="http://www.rentacode...d_6764522">Rent A Coder</a> would be happy to help.

Disclaimer: Free advice is usually worth what you paid for it. ( or at least when it's coming from me! )

#2 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 26 June 2006 - 01:59 AM

Can we see what your talking about? Can we see the html? From what I understand, you have a text in the <textarea>TEXT</textarea> and then the text after it is being displayed as text?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#3 dptr1988

dptr1988
  • Members
  • PipPipPip
  • Advanced Member
  • 372 posts

Posted 26 June 2006 - 02:16 AM

Here is a sample of my editor [a href=\"http://dptr1988.mooo.com/editor_test.php\" target=\"_blank\"]http://dptr1988.mooo.com/editor_test.php[/a] View the source for a better understanding of what I'm wanting. How can I have the < /TEXTAREA> tag in a textarea?
Need more help with your project? One of the thousands of programmers, web designers or artists at <a href="http://www.rentacode...d_6764522">Rent A Coder</a> would be happy to help.

Disclaimer: Free advice is usually worth what you paid for it. ( or at least when it's coming from me! )

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 June 2006 - 08:54 AM

I would suggest you use htmlentities when the data is pulled into the textarea like so:
<textarea ... blah ...><?php echo htmlentities($file_contents); ?></textarea>
then when you got to save the changes use a function called html_entity_decode

This will undo the changes htmlentities did, like so:
$file_contents = html_entity_decode($_POST['textareaName']);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users