Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Disabling the editor
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedDisabling the editor

 Post Reply Post Reply Page  123>
Author
abarker View Drop Down
Newbie
Newbie


Joined: 07 July 2005
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote abarker Quote  Post ReplyReply Direct Link To This Post Topic: Disabling the editor
    Posted: 03 August 2005 at 11:43am
I want to do to RTE something similar to what happens to an html input element when it's disabled attribute is set - you know, the input area gets greyed-out and you can't edit the text. 
 
I want to disable the editor this way so I can prevent user input until a certain action is done and then re-enable it.  Does anybody know how to do this?
 
Thanks
Back to Top
old_techhead View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2005
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote old_techhead Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2005 at 1:57pm
I would think the simplest way would be to have some code in the page that had pseudocode similar to:
 
if permission_not_allowed
    display RTE_text in table cell (no textarea)
else
    display RTE_text in textarea (in table cell)
end if
 
then when permission_is_granted just go through the pseudocode again.
 
Hope that helps. The secret here is to not display the code inside a textarea until you want to be able to edit it.
Back to Top
abarker View Drop Down
Newbie
Newbie


Joined: 07 July 2005
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote abarker Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2005 at 2:11pm

Thanks for your reply.  I could elminate the RTE textarea at times when I don't want it to be edited, but then the editor would disappear.  I want it to appear to the user as if the editor is there, but not able to be edited.

Back to Top
old_techhead View Drop Down
Newbie
Newbie
Avatar

Joined: 03 August 2005
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote old_techhead Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2005 at 2:48pm
Ok... try the tips in this article. This should do what you want...
 
Back to Top
abarker View Drop Down
Newbie
Newbie


Joined: 07 July 2005
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote abarker Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2005 at 3:15pm

Thanks again for the reply.  The problem with this approach is that the textarea element that is used by RTE for some reason isn't affected by the disabled attribute.  I tried it.  For example, the following code normally gives me a disabled textarea:

<textarea name="mytext" cols="70" rows="15" id="mytext" disabled="disabled"></textarea>
 
However, when I add the rest of the html/asp code to the page to have RTE use this textarea, the textarea will no longer be disabled.  I'm not sure how RTE does it, but it effectively invalidates the disabled property for this textarea.
 
I think it'd be great if Web Wiz just included the 'disable' property as a special property that could be turned on and off on the fly since disabling its textarea doesn't do the trick.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2005 at 2:24am
Can't you just put it in a div and use javascript/dhtml to toggle the display off/on?

Lead me not into temptation... I know the short cut, follow me.
Back to Top
abarker View Drop Down
Newbie
Newbie


Joined: 07 July 2005
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote abarker Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2005 at 8:14am
Yes, that would be a fine solution and I almost did that.  But what I really want, for the user's sake, is a way for the wywiwyg editor to be visible but just 'greyed out', like disabled text areas.
 
Thanks for the suggestion though.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2005 at 12:27pm
It's a little hoky, but you could put it in a div and use z-order to put that div behind another of the same size that has an opaque .gif in it.
As long as the div with the opaque .gif is on top and/or displayed it'll intercept anything the user clicks while "dimming" the form.
You can use java script to either toggle the z-order or the display.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply Page  123>

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.