Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Value List in Cells?

Featured Replies

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]&nbsp;</font></p>

</TD>

  • 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?

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

  • 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?

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

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

  • Author

Thanks, Garry!!!

That worked perfectly. Thank you SO much, you have solved a major headache for me! :-)

Well done smile.gif

I guess you realise that you can change the number of colums by amending the "nCols = 3" assignment.

All the best.

Garry

  • 1 year later...

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

nevermind. i'm not sure if i was hallucinating or what, but it does work.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.