October 25, 200223 yr I have coded checkboxes where the FMP-ValueListItem tag draws the values out of the database. However, this particular value list has about 200 items on it, and right now it's formatted with a break <br> after each value item--but the page is still really long. Is there any way to format the Value List so that possibly a table can be created of the Value List? Possibly with two or three columns? I'm not sure if this is possible. This is the code I currently have. It all takes place within a single table cell right now, so I'd like to add a table within this cell if this is possible. <TD colspan="3" height="33"> <p><font size="-3">[FMP-ValueList: Countries, List=Countries] <input type="checkbox" name="Countries" value="[FMP-ValueListItem]" [FMP-ValueListChecked]> [FMP-ValueListItem]<br> [/FMP-ValueList] </font></p> </TD>
October 25, 200223 yr A couple of methods exist, one uses CDML/Calculation Fields and the other uses Javascript. Here is a link to one of them: http://www.fmforums.com/threads/showflat.php?Cat=&Board=UBB22&Number=39074&Forum=UBB22&Words=colums&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=allposts&Main=38987&Search=true#Post39074 A search of these forums may reveal some more information. Good Luck. Garry
October 28, 200223 yr Author I've been searching the forum, and I've tried the various solutions at the link that Garry provided, but I cannot get any of them to work. None of the solutions seem adapatable to checkboxes and pulling value lists. Does anybody else know of a solution for this? Basically what I have is a list of 200 countries in a value list, and letting them run in a single column down the webpage makes the page very long to print out, which is what visitors will be doing. Does anybody have any other ideas?
October 28, 200223 yr Try this: <table><tr> <script>i = 1 ; nCols = 3 ; [FMP-ValueList: Countries, List=Countries] if ((i % nCols) == 0) { document.write("<td><input type="checkbox" name="Countries" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td></tr><tr>") ; } else { document.write("<td><input type="checkbox" name="Countries" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td>") ; } ; i++ ;[/FMP-ValueList] </script></tr></table> Good Luck. Garry
October 28, 200223 yr Author Hi Garry, I pasted your code right into my HTML file, replacing the code from above. Unfortunately, it didn't work. When I ran it through a browser, nothing showed up, just a blank area--where before it was drawing a the long column of value list items from the database. Any ideas?
October 28, 200223 yr Check the "Page Source" of the page in the browser. Can you see the values in that listing? Also, just try it on a section of the page which does not have any other tables or formatting. This is to see if it is not conflicting, and hence not displaying. For example, the <TD height="33"> may cause a problem when the embedded table will be much larger than that. You may have to post most of your page so that we can see what is happening. Or, make another page, for testing, which is very simple and plain. All the best. Garry
October 28, 200223 yr Whoops, I forgot about the quotes when I copied and pasted. It should be: <table><tr> <script>i = 1 ; nCols = 3 ; [FMP-ValueList: Countries, List=Countries] if ((i % nCols) == 0) { document.write("<td><input type="checkbox" name="Countries" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td></tr><tr>") ; } else { document.write("<td><input type="checkbox" name="Countries" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td>") ; } ; i++ ;[/FMP-ValueList] </script></tr></table> This should work (I have tested it). Garry
October 28, 200223 yr Author Thanks, Garry!!! That worked perfectly. Thank you SO much, you have solved a major headache for me! :-)
October 28, 200223 yr Well done I guess you realise that you can change the number of colums by amending the "nCols = 3" assignment. All the best. Garry
December 12, 200322 yr Okay, a year later.... When I use this code it displays properly. However, it doesn't work because the html it ends up generating includes all of the scripting stuff. For example, the code (from "view source") is: <table><tr><script> i = 1 ; nCols = 3; if ((i % nCols) == 0) { document.write("<td><input type="checkbox" name="Genre" value="adventure">adventure</td></tr><tr>");} else { document.write("<td><input type="checkbox" name="Genre" value="adventure">adventure</td>");}; i++; if ((i % nCols) == 0) { document.write("<td><input type="checkbox" name="Genre" value="animals">animals</td></tr><tr>");} else { document.write("<td><input type="checkbox" name="Genre" value="animals">animals</td>");}; i++; etc. the code in the unprocessed HTML is: <script> i = 1 ; nCols = 3; [FMP-ValueList: Genre, List=Genre List] if ((i % nCols) == 0) { document.write("<td><input type="checkbox" name="Genre" value="[FMP-ValueListItem]">[FMP-ValueListItem]</td></tr><tr>");} else { document.write("<td><input type="checkbox" name="Genre" value="[FMP-ValueListItem]">[FMP-ValueListItem]</td>");}; i++;[/FMP-ValueList] </script> Help? Thanks, Carrie
Create an account or sign in to comment