Manage Learn to apply best practices and optimize your operations.

Dynamic Multi-Column Checkbox on Web

You want to use multi-column checkboxes on the Web sourced from a keyword list, but they don't align properly. Using pass-thru HTML is fine if the number of checkbox options is finite.

This script dynamically populates a number of checkbox columns from a keyword list. Include in the WebQueryOpen event of the Web form.

In this example, we populate three hidden multi-value fields on the Web form.

The list of keywords is sourced form a field called 'keywords' on a document called keydoc.

Dim maxnum As Integer
Dim count1, count2, count3 as Integer ' count no. of elements in each column
Dim pass As Integer 'count no. of loops

'determine max no. of keywords
maxnum = Ubound( keydoc.keywords)

Redim key_array1(maxnum) As String
Redim key_array2(maxnum) As String
Redim key_array3(maxnum) As String

count1 = 0
count2 = 0
count3 = 0
pass = 0

'loop through keyword list populating arrays

For i = 0 To maxnum + 2 Step 3

key_array1(pass) = keydoc.keywords(i)
count1 = count1 + 1
If i = maxnum Then Exit For

key_array2(pass) = keydoc.keywords(i + 1)
count2 = count2 + 1
If i+1 = maxnum Then Exit For

key_array3(pass) = keydoc.keywords(i + 2)
count3 = count3 + 1
If i+2 = maxnum Then Exit For

pass = pass + 1


Redim Preserve key_array1(count1-1) As String
Redim Preserve key_array2(count2-1) As String
Redim Preserve key_array3(count3-1) As String

curPage.key_array1= key_array1
curPage.key_array2= key_array2
curPage.key_array3= key_array3

Simply set the formula for each one of checkbox fields to one of the hidden fields.

You must include the logic to process three checkboxes at form submit.

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...