MarvinView Example 2.4

Pressing the Search button calls a CGI script. The Do it! button, the Yes/No "button-like checkbox", the checkbox and the image buttons (the charts) trigger JavaScript expression evaluations.

The first two arguments of a checkbox in a celli parameter are its labels for the two states (up and down). Both are empty strings for the "real" checkbox. The third argument is the initial state: empty string or 0 for up, 1 for down. The fourth and fifth arguments are the JavaScript expressions evaluated when checking and unchecking. The JavaScript expressions begin with js:.

The molecule name ("first", "second", "third", or "fourth"), the number of checkboxes in the applet and the checkbox states are arguments of the CGI script called when Search is pressed.
There are 6 checkboxes; their states are described by the 6 bits of the hexadecimal number substituted into the string %C in the CGI script URL.

<script LANGUAGE="JavaScript1.1" SRC="../../marvin.js"></script>
<script LANGUAGE="JavaScript1.1">
<!--
mview_mayscript = true;
mview_begin("../..", 440, 370);
mview_param("rows", "2");
mview_param("cols", "2");
mview_param("border", "1");
mview_param("layout", ":6:2:"
+"M:0:0:6:1:"
+"L:0:1:1:1:n:n:"
+"B:1:1:1:1:n:h:"
+"B:2:1:1:1:n:h:"
+"C:3:1:1:1:n:h:"
+"C:4:1:1:1:n:"
+"I:5:1:1:1:n");
mview_param("param", ":M:150:150:"
+"L:10:"
+"B:10:search for more molecules like this:_self:"
+"B:10:execute some JavaScript::"
+"C:10:execute something else:"
+"C:10:select molecule");
mview_param("cell0", "|../../mols-2d/caffeine.csmol"
+"|first| Search |%|example-searchmore2.cgi?mol=first&n=6&cbx=%C"
+"| Do it! ||js:alert('first')"
+"| No | Yes |0|js:alert('No!')|js:alert('Yes!')"
+"|||0|js:alert('First unselected')|js:alert('First selected')"
+"|../../img/easychart1.gif|js:alert('Chart 1 clicked')|");
mview_param("cell1", "|O[C@H](\C=C\[C@@H](O)C1=CC=CC=C1)C2=CC=CC=C2"
+"|second| Search |%|example-searchmore2.cgi?mol=second&n=6&cbx=%C"
+"| Do it! ||js:alert('second')"
+"| No | Yes |0|js:alert('No!')|js:alert('Yes!')"
+"|||1|js:alert('Second unselected')|js:alert('Second selected')"
+"|../../img/easychart2.gif|js:alert('Chart 2 clicked')|");
mview_param("cell2", "|Ethane\n"
+"  Marvin  07119915552D\n"
+"\n"
+"  2  1  0  0  0  0  0  0  0  0999 V2000\n"
+"   -0.5625    1.2500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"
+"   -0.5625    0.2500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\n"
+"  1  2  1  0  0  0  0\n"
+"M  END\n"
+"|third| Search |%|example-searchmore2.cgi?mol=third&n=6&cbx=%C"
+"| Do it! ||js:alert('third')"
+"| No | Yes |1|js:alert('No!')|js:alert('Yes!')"
+"|||0|js:alert('Third unselected')|js:alert('Third selected')"
+"|../../img/easychart3.gif|js:alert('Chart 3 clicked')|");
mview_param("cell3", "|C[C@]12CC[C@@H]3[C@H](CC[C@H]4CC(=O)C(\C[C@]34C)=C\O)[C@@H]1CCC(=O)O2"
+"|fourth| Search |%|example-searchmore2.cgi?mol=fourth&n=6&cbx=%C"
+"| Do it! ||js:alert('fourth')"
+"| No | Yes |1|js:alert('No!')|js:alert('Yes!')"
+"|||0|js:alert('Fourth unselected')|js:alert('Fourth selected')"
+"|../../img/easychart4.gif|js:alert('Chart 4 clicked')|");
mview_end();
//-->
</script>

Now you will see how to use colors and 3D features in a table.