Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to store data in specific format? in WYSWYG?

I am using WYSIWYG window 4 taking input from user, so he can enter font Bold, Italic etc. How to store such data, so that when I display on some other page, same font styles and formats comes back??

like image 494
Arpit Gupta Avatar asked Sep 11 '12 11:09

Arpit Gupta


2 Answers

The WYSIWYG is nothing but a Div tag with "Contenteditable" attribute, which will help capture bold, italic etc. and the content you see is rendered version of the html.

if you want to get the HTML just get the innerHTML of the contenteditable div it will give you html code. let me know if you need more help.

like image 180
Chandra Sekhar Walajapet Avatar answered Oct 29 '22 17:10

Chandra Sekhar Walajapet


You can make a class called FontMetadata, and store the data in a tuple like

Tuple<Data, DataStyle>
like image 43
Freeman Avatar answered Oct 29 '22 15:10

Freeman