Knowledge Base > RichTextBox > Implementation Knowledge Base Home | Login
Search the Knowledge Base
 
Start Search in the Following Category

Accessing the editor document from client script

To get at the contents of the editor from client script, you need to access the contents of the <iframe> tag in the page. The ID of the iframe is the name of the editor (e.g. richtext1) plus "_x5". RichTextBox v2.0 has got a property called EditorClientID , which will return this concatenation automatically. If you add an editor to the page called richtext1, there will be an HTML tag in the page like this:

<iframe id="richtext1_x5" ... ></iframe>

To access the contents of that iframe, add this code to the end of the HTML page:

<script>
alert('Document contents = ' + richtext1_x5.document.body.innerHTML);
</script>

 




Did this page answer your question? If not, try the Forums or contact us.

Copyright Richer Components 2005. All rights reserved. No part of this article may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without the prior written permission of Richer Components. All brand names and product names used in this article are trade names, service marks, trademarks, or registered trademarks of their respective owners.


Knowledge Base Software - myKB.com