< Back

Document Subject: Checkbox Columns in Table on Web
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#DominoCheckboxColumns or http://A555F9/nn.nsf/ByAlias/DominoCheckboxColumns

Checkbox Columns on a lotus notes domino web page are a bit of a palaver, as they do not match up nicely in even columns. This is a bit of a problem and was an issue for a customer, there are a few different options for solving this, some using the javascript DOM etc but here is mine. It is pretty simple an works well when saving and reopening the document.




 

Put on the notes form pass thru html:

<table border=0 rowpadding=0 rowspacing=0 CELLSPACING=0 CELLPADDING=0  style='border-collapse: collapse;' ><tr>

then put the checkbox field "Call_Type" as before, but with properties  HTML Style

display:none;

and put in an properties html id eg:

two_col_checkbox

Then you need a computed field with pass thru ticked:


lookup:=@DbLookup("""""keywords""Call Type";2);
r:=@If(@IsError(lookup);"Could not find keyword 'Call Type'";lookup);
st:=" style='  font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: normal;' "
cols:=2;
list:= ""
@For(n:=1;n<=@Elements(r);n:=n+1;

a := @If(@Modulo(n;cols)=0;
"<td "+st+"><small><input style='vertical-align:middle;' type=\"checkbox\" name=\"Call_type\" "+@If(@IsMember(r[n];Call_type);" checked """)+" value=\""+r[n]+"\" id=\"two_col_checkbox\" >"+r[n]+"</small></td></tr><tr>"
"<td "+st+"><small><input style='vertical-align:middle;' type=\"checkbox\"   name=\"Call_type\" "+@If(@IsMember(r[n];Call_type);" checked """)+" value=\""+r[n]+"\" id=\"two_col_checkbox\" >"+r[n]+"</small></td>" );

list:= @If(list=""a;list:a)

);

@Implode(list;" ")+@If(@Modulo(n;cols)>0;"</tr>""")

then finish off web page with:

</table>

This worked well in Internet Explorer 7 and Firefox 3.0.7 and should work in all browsers.