Jump to content

This topic is 7722 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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>

Posted

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?

Posted

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

Posted

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?

Posted

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

Posted

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

  • 1 year later...
Posted

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

This topic is 7722 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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