Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Maximum Length of Content for the RTE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedMaximum Length of Content for the RTE

 Post Reply Post Reply
Author
markdinho View Drop Down
Newbie
Newbie


Joined: 26 June 2006
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote markdinho Quote  Post ReplyReply Direct Link To This Post Topic: Maximum Length of Content for the RTE
    Posted: 20 July 2006 at 1:17am
I have used the RTE to upgrade my standard Text Areas. My old Text Areas had an OnKeyUp Event which called a Javascript function called CheckMax:
 
onKeyUp="checkMax(this.form)"
 
This Javascript function basically checked that the input was no longer that 8000 characters. It would update a textBox on the Form to indicate how many characters are left.
 
Here is the Javascript Function:
function checkMax(j){
    intMaxLen = 8000
    if (j.txtIssueNotes.value.length <= intMaxLen) {
         intCharsLeft = intMaxLen - j.txtIssueNotes.value.length
    }
    else {
          j.txtIssueNotes.value = j.txtIssueNotes.value.substring(0,intMaxLen) intCharsLeft = 0
     }
     j.txtCharsLeft.value = intCharsLeft
}
 
 
The problem is now that with the RTE controlling the TextArea, this no longer works.
Any ideas on how I could get it to work again?
 
Thanks
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2006 at 9:10am
Such a system isn't really possiable in an RTE area.

The reason for this is that the RTE uses also HTML to format the text which would also be counted even though the end user can not see this.

The other problem, is that the RTE actually uses an IFrame to make it work, which is overlayed over the top of the original text area (otherwise the entire would become editable). Your original textarea is only populated (updated) when the submit button is pressed to submit the form.
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.