Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - RTE MOD *Access Multiple RTE per page*
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedRTE MOD *Access Multiple RTE per page*

 Post Reply Post Reply
Author
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post Topic: RTE MOD *Access Multiple RTE per page*
    Posted: 13 April 2005 at 9:29am

For the portal I'm currently building, I needed on some of my pages to have up to 3 RTE editors which obviously isn't possible so I created myself a little MOD to do this with, it doesn't show the editors on the page, it shows the textareas, which can call the editors using a link or even using an onclick attribute on the textarea, and then shows a popup with the editor in.

On the page you are wanting your multiple RTE editors put the following JS function in the head tag of the page.
 

 
// function to show RTE Editor for advanced textarea editing
function doTheAdvancedTextAreaEditing(formName, textAreaID){
// ok we now need to open a pop up window to show the RTE Editor
window.open('/portal/RTE/advanced_text_area.asp?strFormName='+ formName +'&strTextAreaID='+ textAreaID +'', 'advancedTextAreaRTE', 'width=700, height=600, scrollbars=1, status=1')
}
 
 
Now here is the code for the advanced_text_area.asp page
 

 
<%
Dim strFormName

Dim strTextAreaName

'Edit the intilised variables below to put in the name of your textrea's ID and the name
'of the form the textarea is within

'Name of the HTML form the textarea is within
strFormName = request.QueryString("strFormName")

'ID tag name of HTML textarea being replaced
strTextAreaName = request.QueryString("strTextAreaID")
%>
 
<html>
 
<head>
 
<script language="javascript">

function giveTheTextAreaAValue(){
// Populate the textarea with the value from the opener textarea

document.forms.<%= strFormName %>.textarea.value = window.opener.document.forms.<%= strFormName %>.<%= strTextAreaName %>.value

}
 
function updateTextAreaAndCloseMe(){

// first of all update the text area in the window opener

window.opener.document.forms.<%= strFormName %>.<%= strTextAreaName %>.value = document.getElementById('WebWizRTE').contentWindow.document.body.innerHTML

// Now that we have updated the opener with the formatted HTML code we can now close this window.
window.close()
}
</script>
 
<!--#include file="RTE_configuration/browser_page_encoding_inc.asp" -->
 
</head>
 
<body OnLoad="giveTheTextAreaAValue();initialiseWebWizRTE();">
 
<form name="<%= strFormName %>">    
      
<!-- include the Web Wiz Rich Text Editor -->
<!--#include file="RTE_editor_inc.asp" -->
      
<textarea name="textarea" cols="80" rows="15" id="<%= strTextAreaName %>"></textarea>
         
<input type="button" name="Submit" value="Update" onClick="updateTextAreaAndCloseMe()">

<input name="reset" type="reset" value="Reset Form">
        
</form>
     
</body>
 
</html>
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.