开发者

Can we add an image to a text area? If so how?

开发者 https://www.devze.com 2023-03-12 03:22 出处:网络
I have a text area and when the user clicks a button say something like insert an image button the user selects the imag开发者_开发技巧e to be uploaded and then i would like to add this image to the t

I have a text area and when the user clicks a button say something like insert an image button the user selects the imag开发者_开发技巧e to be uploaded and then i would like to add this image to the text area and the user can continue editing the text area, just like what orkut does. How do we achieve such functionality?


You can't display an image directly inside a textarea control.

The closes you can get is overlay an image on it, but it will not be part of the information in the textarea. That is, text will not flow around it and when posting the form it will not be included in the data for the textarea.

Perhaps a writable div (content editable) would suit your purposes better.


I don't believe this is possible. You should look into using a content editable div.


I don't think Orkut actually does what you are talking about either. Looks like they are doing the same thing that stackoverflow does - using a wysiwyg editor, albeit a nicely dressed up or homegrown version. TinyMCE and FCKeditor are the two I'm most familiar with. There are a few leads on this page too: html editor alternative besides tinyMCE

0

精彩评论

暂无评论...
验证码 换一张
取 消