Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to limit the text lenght?

Status
Not open for further replies.

Mendocino

Technical User
Mar 23, 2003
3
CH
Dear all,

A query about the length limit of a text field. I want to limit the number of characters a user is allowed to enter into a text field (it can a Rich text field if need be) to 1000 characters (about 150 words).

On the Notes client side, validation will alert the user only after the text has been entered. Is there a way of disabling character input once the limit is reached on the Notes client just as the way it works on web client?

On the web client side, no input will be possible after the limit is reached. However, the text field is only a one-line window. Its width can be increased thru HTML attributes (Size = "xxx"). I do not know how to increase the height of the text field.

One more thing: is it possible to include a field that will either display the total number of characters in the text already entered or display in real time how many characters remaining that a user can enter?

I would be grateful if someone can help me on this.

 
For the Notes part, you can use the OnChange event and write either in LScript, Java or CommonJava.
For the Web, same event, but only Java or CommonJava.

It would be best to write out something in CommonJava, so as to solve the issue in one go instead of maintaining two code threads.

Be aware, though, that my experience tells me that the Notes reacts very badly (in terms of performance) to anything that is outside of the Default, Input Translation and Input Validation formulas. The Notes client has a very real tendancy to get horribly bogged down by the slightest bit of code in the OnChange event, and what you want to do will require quite a few lines if I'm not mistaken.
The Web client should be fine, though.
 
Thanks for the tips and sorry for the late reply as I have not received any email notification although the notify option was requested.
I do not know LotusScript or Java for the OnChange event and would appreciate help if it is not too much a hassel.
 
If you are not a developer, I would seriously counsel you to hand this over as a request to the IT department.
Developing code for Notes is not your typical type-a-macro Excel thing. If you absolutely need to code this yourself, I would suggest you start by checking the Sandbox on for any existing code on this subject.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top