OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Make DIV text editable
This page's ID:
11151
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
poi is absolutely right, here is an example of the IE MSHTML component/javascript thing. Take a look at this: [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>wysiwygtests</title> </head> <body> <form action="#" name="testEdit"> <div id="test" contenteditable="true"> test text here </div> <span id="controls" unselectable="on"> <a href="javascript:void(0);" onclick="document.execCommand('CreateLink')"> link</a> <a href="javascript:void(0);" onclick="document.execCommand('Bold')"> bold</a> </span> <br><br><input type="button" value="Show source" onclick="alert(document.getElementById('test').innerHTML);"> </form> </body> </html> [/code] The keys here are 3 things: 1 - the tag [b]contenteditable="true"[/b] that makes that specific element editable. 2 - the tag [b]unselectable="on"[/b] that makes sure that the focus isn't moved from the selected object to the control as you mainipulate it with the controls. 3 - To actually save your changes you need to send what I'm now alerting to a serverside script that either saves it in the db or writes it to a file. Ton's of referencematerial for the manipulation of the editable content can be found here: [url=http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/editing/mshtmleditor.asp]http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/editing/mshtml editor.asp[/url] /Dan [url=http://www.dmsproject.com/] [img]http://www.dmsproject.com/gif/newSiggie.gif[/img] [/url] [url=http://faq.ozoneasylum.com/FaqWiki/shownode.php?sortby=rating&id=260]{cell 260}[/url] -{ a vibration is a movement that doesn't know which way to go }- [This message has been edited by DmS (edited 02-19-2004).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »