About Duffbert...

Duffbert's Random Musings is a blog where I talk about whatever happens to be running through my head at any given moment... I'm Thomas Duff, and you can find out more about me here...

Email Me!

Search This Site!

Custom Search

I'm published!

Co-author of the book IBM Lotus Sametime 8 Essentials: A User's Guide
SametimeBookCoverImage.jpg

Purchase on Amazon

Co-author of the book IBM Sametime 8.5.2 Administration Guide
SametimeAdminBookCoverImage.jpg

Purchase on Amazon

MiscLinks

Visitor Count...



View My Stats

« The Indexer and Its Functionality | Main| Liking the new job... »

Is it Possible To Create an Input Validation of a Rich Text Field?

Category Software Development

Something you'd probably figure out if you thought about it long enough, but this might save you a few seconds...  From the KnowledgeBase...

Is it Possible To Create an Input Validation of a Rich Text Field?

Document Number:  1103383

Problem
A customer would like to be able to prevent users from leaving a Rich Text field (RTF) without entering text.  The Rich Text field does not have an Input Validation formula associated with it.  How can a user be forced to enter text in the Rich Text field before saving the document?

Content
For the following it is presumed that the Rich Text field is called "rtfield".

1.        Below the Rich Text field on the form create a Text field.  This allows you to use its Input Validation formula to point to the Rich Text field.  If needed the Text field could be hidden from the user and used explicitly for design purposes.

2.        In the Input Validation formula of the Text field enter the following formula:

@If(@Abstract([TextOnly];10;"";"rtfield")="";@Failure(" you must enter some text ");@Success)


Note:    When referencing a Rich Text field you will not be able to check for an empty field value by using:

a)  @If(rtfield = ""; ....)
b)  @If(@Contains(rtfield; ""); ....)

In addition, the [textonly] parameter does not consider file attachments as text.   Thus, the user will still be forced to enter text in addition to the file attachment when the [textonly] option is used.

Supporting Information:

This process can also be done with LotusScript in the Exiting event of the Rich Text field.  Refer to the technote, "How to Lock Documents via LotusScript to Prevent Simultaneous Access" (#155070) for a good example.

Comments

Gravatar Image1 - That's cool! Thanks for sharing! (whoever you are...)

Gravatar Image2 - Add this this in the query save:
..Code ...

'Selection and deselecting an empty field will create 4407 error:
On Error 4407 Goto RichTextEmpty
call source.gotofield("RTField")
call source.selectall()
call source.Deselectall()

...rest of the code...

exit sub
RichTextEmpty:
msgbox "Please put somthing in the richtext field"
call source.gotofield("RTField")
continue=false
exit sub

i think it works for Windows only.


Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Want to support this blog or just say thanks?

When you shop Amazon, start your shopping experience here.

When you do that, all your purchases during that session earn me an affiliate commission via the Amazon Affiliate program. You don't have to buy the book I linked you to (although I wouldn't complain!). Simply use that as your starting point.

Thanks!

Thomas "Duffbert" Duff

Ads of Relevance...