I'm currently working on an online content management system which allows users to edit html-pages without seeing the HTML-tags.
Is it possible to use buttons for text formatting? I would like to have buttons for adding a link and adding headers. But without showing the user the html-tags.
Could anyone help me with this problem? Any help would be appreciated!
Yep, there's a solution (I think) but it requires IE5+. i'll get back to you on this.
Ok, Im gonna give u the jist of the solution since i don't really have time to go right into it. :xeye:
Basically, what u need to do is to define an area of your page as being contentEditable, which allows users to actually type over the contents of a specified zone. To embolden a word, the user would drag the mouse over that word (just like in a wordprocessor) and then click on a button to make that textRange bold.
While this is going on, the contents of the editable zone would be copied to an hidden field, including the added formatting tags. Click on a button/hyerplink to upload/submit to database/CGI script.
I'm 80% sure this can be done, and will probably try it myself, just not right now. :teleport:
As u can imagine, this would be on helluva script to code, so if u do attempt it, tell us how u get on. The results (if successful) should be quite impressive! :cool:
Go here to find out more about the contentEditable property of IE5+ ...