Validating Selection Lists

Selection lists are handled in the same way as other nontext objects using a for loop:

function windowreturn(field1){ 
myForm=document.forms[0];
 for (var i=0; i < myForm.field1.length; i++){
 if (myForm.list[i].selected) {
 choice = true;
 }
 }
self.close();
}

Here's an example using JavaScript to verify that no more than x number of options are selected in a selection list field:

choices = 0; 
for (var i=0; i < field1.length; i++){
 if (form.list[i].selected) {
 choices++;
 }
}
if (choices > 5) {
 alert("Sorry you can only pick 5 choices!");
} else {
 alert("You picked " + choices + " choices!");
}

Part I. Introduction to Release 6

Whats New in Release 6?

The Release 6 Object Store

The Integrated Development Environment

Part II. Foundations of Application Design

Forms Design

Advanced Form Design

Designing Views

Using Shared Resources in Domino Applications

Using the Page Designer

Creating Outlines

Adding Framesets to Domino Applications

Automating Your Application with Agents

Part III. Programming Domino Applications

Using the Formula Language

Real-World Examples Using the Formula Language

Writing LotusScript for Domino Applications

Real-World LotusScript Examples

Writing JavaScript for Domino Applications

Real-World JavaScript Examples

Writing Java for Domino Applications

Real-World Java Examples

Enhancing Domino Applications for the Web

Part IV. Advanced Design Topics

Accessing Data with XML

Accessing Data with DECS and DCRs

Security and Domino Applications

Creating Workflow Applications

Analyzing Domino Applications

Part V. Appendices

Appendix A. HTML Reference

Appendix B. Domino URL Reference



Lotus Notes and Domino 6 Development
Lotus Notes and Domino 6 Development (2nd Edition)
ISBN: 0672325020
EAN: 2147483647
Year: 2005
Pages: 288

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net