Home > Ask the Domino Experts > Domino Designer Questions & Answers > How can I validate a Rich Text field? And which access level wins?
Ask The Domino Expert: Questions & Answers
EMAIL THIS

How can I validate a Rich Text field? And which access level wins?

Maureen Leland EXPERT RESPONSE FROM: Maureen Leland

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 05 September 2003
How can I validate a Rich Text field? Can I use JavaScript and LotusScript? If so, how?

Also, in a database, one user is assigned in GroupA and GroupB. In GroupA the user has Reader access level, and in GroupB the user has Author access level. Which access level applies to this user?


>
To answer the second part first, the user who is in both groups would have Author access level -- when a user is contained in multiple groups, he or she is given the highest access level allowed of any of the groups.

Yes, you can validate a Rich Text field with JavaScript and LotusScript. With LotusScript, you can use the FieldGetText method on the NotesUIDocument class to get a regular string to test. Here is a quick example of validating a Rich Text field with LotusScript:

 Dim uiws As New NotesUIWorkspace,
 uidoc As NotesUIDocument
 Dim sRichText As String
 Set uidoc = uiws.CurrentDocument
 sRichText = uidoc.FieldGetText("rt")
 ' Sample Validation code
 If sRichText = "" Then
  Msgbox "please input rich text"
 Else
  Msgbox "the rich text entered is: " + sRichText
 End If
And here is a similar example of JavaScript code to do the same thing, in this case using the DOM to access the value of a field named rt.
sRichText = document.
forms[0].rt.value
// Sample validation code
if (sRichText == "") 
{
alert("Please input some rich text")
}
else
{
alert("the rich text you entered is: "
 + sRichText)
}


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino Designer
Resolve Notes 8 migration error: 'Database has not been opened yet'
Lotus Notes access error: 'database is not opened yet'
Stop response documents from showing in a Lotus Notes form
Set a value in a field existing in another Lotus Notes database
Create an automatic scheduled view export in Excel
Display Lotus Notes fields as separate entries in one column
Creating custom Lotus Notes Domino login forms
Using LotusScript to retrieve names of fields on a Lotus Notes form
Importing data from Microsoft Excel to a Lotus Notes form
Error creating product object

JavaScript for Lotus Notes Domino
Trap JavaScript runtime errors in Domino Web apps
JavaScript workaround fixes Lotus Notes 8.x PostOpen event issue
Write HTML and JavaScript in Notes view rows and columns on the Web
JavaScript detects Web browser type and version in Notes/Domino 8.0.2
JavaScript creates a jump box on a Lotus Notes Web form
Top 10 Lotus Notes/Domino coding and development tips of 2008
How to create dynamic JavaScript in Notes Domino without formulas
Trap an attachment path via the Domino file upload control field
Converting Lotus Notes views to XML documents using JavaScript
Mimic Lotus Notes Domino application functionality on the Web

LotusScript
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts